Using Borders - Post ID 240959

User 187934 Photo


Senior Advisor
20,271 posts

When using elements like img, div and such you only want to apply styles that would be needed for ever one of those on your page. Generally speaking you would not use any kind of positioning on those generic elements.
You would use things like color and font size.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2724156 Photo


Guest
1 post

.left {
width: 30%;
border: 3px solid #000;

-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
Use the box-sizing: border-box property. It modifies the behaviour of the box model to treat padding and border as part of the total width of the element (not margins, however). This means that the set width or height of the element includes dimensions set for the padding and border. In your case, that would mean the element's width and it's border's width would consume 30% of the available space.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.