Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

How HTML/CSS Borders Affect the Size and Layout of Your Webpage

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,029
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 26, 2010

How the CSS border attribute affects the layout of your website. It is not calculated in as part of your width, so adding it, can negatively effect your pixel perfect layout. This video shows a way around that issus however, so you can better protect layout.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (waltdesignanddevelop)

  • The effect is the same. If you have an element, and set it's width to 400px, then add a 2px border, your element is actually 404px wide (2px on each side).

    [div id="element "][div id="innerElement "]...[/div][/div]

    #element { width: 400px; border: 2px solid #000; }

    Solution: add the inner element. #element { width: 400px;} #innerElement {border: 2px solid #000; }

    Hope that helps.

see all

All Comments (2)

Sign In or Sign Up now to post a comment!
  • aww I really want to know this specific information because it's happening to me right now. but you use dreamweaver and I'm doing ti by hand. :(

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more