css - span causes content inside to be lower? -
i'm adding span wrap part of text can apply specific font it, reason drops below part of under baseline of paragraph contains text.
anyone have ideas on how move ( span ) on same line rest of text?
i'm trying relative positioning, i'm wondering if there better way.
here code:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <style type="text/css"> html, body{ margin:0; padding:0; font-size:16px; } .container{ height:342px; width:100%; padding-top:2em; padding-left:2em; background:#ffffff; background:rgb(255, 255, 255); -moz-box-sizing:border-box; -webkit-box-sizing:border-box; box-sizing:border-box; color:#333333; color:rgb(51, 51, 51); font-family:'trend'; font-size:120%; font-size:1.2rem; *behavior:url(../scripts/boxsizing.htc); } #welcome{ background:#8cc047; background:rgb(140, 192, 71); } #welcome p.title{ margin:0; font-size:225%; font-size:2.25rem; } #name{ position:relative; font-family:'cubano-web',cubano,'trend'; left:16px; top:-7.1px; } </style> </head> <body> <header class="container" id="welcome"> <p class="title">hello,</p> <p class="title">i'm <span id="name">noah</span>—</p> </header> </body> </html>
hello in first line , other text in line if need add css title class
.title{ clear:both; float:left; display:inline; }
and remove top , left property #name
making this..
remove position:relative
also;
#name{ font-family:'cubano-web',cubano,'trend'; }
here fiddle
http://jsfiddle.net/tfj2x/1/
Comments
Post a Comment