css - Padding of Title is outside of the div -
I have created a jsfiddle where you can see the problem padding the heading out of the div:
& lt ;! - HTML - & gt; & Lt; Div & gt; & Lt; H2 & gt; & Lt; A href = "#" & gt; This is a test lesson & lt; / A & gt; & Lt; / H2 & gt; & Lt; / Div & gt; / * Css * / div {status: relative; Swim left; Width: 500px; Height: 300px; Background: Red; } Div h2 {status: absolute; Bottom: 0; Left: 0; Margin: 0; } Div h2 a {padding: 10px 20px; Background: green; } Do anyone know how to fix it?
add display: block , follow the following pre> div h2 a {padding: 10px 20px; Background: green; Display area; / * Added rule * /}
Comments
Post a Comment