stupid CSS issue

Soldato
Joined
6 Mar 2008
Posts
10,078
Location
Stoke area
Hi all,

I have a silly issue with a div and my brain is just overloaded with info so I can't seem to figure it out.

Text sits on the edge of the border, so you add padding-left of 5px to move it away. This then has the issue of adding 5px to the total width of the div meaning that it now sticks out slightly further than the one above and below.

text-indent only works on the first line of a text block.

It's a responsive div so set to 100% so can't subtract it from the total width.

Am i being stupid here and completely overlooking something?
 
Last edited:
Associate
Joined
21 May 2013
Posts
1,975
box-sizing: border-box;

This makes it so your block element will always be the specified width INCLUDING padding, borders, etc.

edit: snap, above xD
 
Back
Top Bottom