DIV cell border size issue

6 replies
  • WEB DESIGN
  • |
Hi,

I've been setting DIV cell dimensions in terms of %, in order to make things more fluid when pages are viewed when zoomed in/out.

The problem is that my borders, paddings, margins are still easier to set in terms of percentage (don't know how I could set a thin border, if not in pixels).

How do you set the DIV borders, margins, paddings if the DIV widths and heights are already in %?
#border #cell #div #issue #size
  • Profile picture of the author RobinInTexas
    I would stick with pixels for borders, padding, and margins. In those cases you are dealing with numbers that are so small they are insignificant.
    Signature

    Robin



    ...Even if you're on the right track, you'll get run over if you just set there.
    {{ DiscussionBoard.errors[8700426].message }}
  • Profile picture of the author shipwrecked
    I do that but when zooming out, it gets "jumbled". One DIV gets under the other etc. etc.
    Not even 1 pixel can be called "insignificant". If I have 60 % and 40 % for two DIVs that have 1 px border, the things don't fit near each other...

    This is what I do EXACTLY: I have a 2 DIV cells inside a big wrapper, one by one. Both float left. Side-by-side.
    The left one is 60 % width, the right one is 40 % in width.

    Problem is that after setting 1 px border width for each DIV and 5 px margin-left for the right (40 % wide) DIV, the entire thing "jumbles up" and I have to take off a few percentaged (like - e.g.: 59 % and 34 %) for them to "fit in"...

    How can this be done better? I can't seem to be able to work with percentages and pixels together...
    {{ DiscussionBoard.errors[8700430].message }}
  • Profile picture of the author Ziga Solution
    Hi ShipWrecked,
    Check this article, I use it almost all the time, its pretty awesome:
    Responsive Web Design just got Easier with the Responsive Grid System
    and regarding those % and pixels I use both.. but you could try also em instead of px..
    {{ DiscussionBoard.errors[8700638].message }}
  • Profile picture of the author shipwrecked
    I am actually trying to make a flexible fluid design, but I think I have an idea: I will use a background DIV that will have the borders in px. On top of the will come a wrapper that will be just 1 and 1 px narrower in width and will be in %...

    Basically, the pixel borders will be the big wrapper DIV's borders, what's inside will be in percent!

    And there are a few other slight adjustments for the other borders that I just won't bore you with...
    {{ DiscussionBoard.errors[8707268].message }}

Trending Topics