I'm having a trouble with text positioning. I use "h6" as title for information block. I would like to make from top and left side a 10px gap but I can't make 10px gap from top, thers more than 10px. Left side is fine.
HTML:
<!DOCTYPE html> <html> <head> <title>Sākums</title> <link rel="stylesheet" type="text/css" href="css/main.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> </head> <body> <div class="container"> <div class="log_me"> <div class="log_inf"> <div class="log_inf_titl"><h6>Uzmanību!</h6></div> <div class="log_inf_tex"><p>Lorem ipsum dolor sit <a href="#">amet</a>, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p></div> </div> </div> </div> </body> </html> CSS:
@font-face { font-family: OpenSans-Regular; src: url(font/OpenSans-Regular.ttf); } body { background: #f2f2f2; } .log_me { background: #fff; border: solid 1px #e4e4e4; height: 211px; width: 300px; position: absolute; } .log_inf { border: solid 1px #f2f2f2; background: #fff; height: 70px; width: 278px; position: absolute; top: 10px; left: 10px; } h6 { font-family: OpenSans-Regular; font-size: 11px; color: #707070; margin: 0; padding: 0; -webkit-margin-before: 0px; -webkit-margin-after: 0px; -webkit-margin-start: 0px; -webkit-margin-end: 0px; font-weight: normal; display: block; } p { font-family: OpenSans-Regular; font-size: 11px; color: #707070; margin: 0; padding: 0; -webkit-margin-before: 0px; -webkit-margin-after: 0px; -webkit-margin-start: 0px; -webkit-margin-end: 0px; font-weight: normal; display: block; } .log_inf_titl { position: absolute; top: 10px; left: 10px; } .log_inf_tex { position: absolute; top: 23px; left: 10px; } Thankyou, Ričards.