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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -