Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correcting 100% width with anchors adding in padding

Tags:

css

Ok, so I have a class that modifies the looks for a specific type of anchor that I'm using, but the problem is that the browsers keep adding the 30 pixels of padding that I have set onto the defined 100% width, so it's stretching out past the box which the anchor is located in.

div.box div div div a.option_line {
    cursor: pointer;
    display: block;
    font-weight: normal;
    min-height: 30px;
    padding: 0px 10px 0px 20px;
    text-align: justify;
    width: 100%;
}

Can anyone think of a way to make the anchor stay within the boundaries of the box?

like image 249
animuson Avatar asked Dec 22 '22 06:12

animuson


1 Answers

Just take out the width: 100%, as the a is declared to be a block level element, it will stretch to the maximum width available without going over.

like image 132
Tatu Ulmanen Avatar answered Jan 08 '23 02:01

Tatu Ulmanen