Center Box with HTML5 -
Center Box with HTML5 -
i have problem center textbox area using html5 here code
`<!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled document</title> </head> <body> <div class="smart_pdbox" style=" width: 366px; border: 1px solid #fff; height: 320px; float: left; margin: 5px 29.75px 5px 29.75px; padding: 12px 5px 0 5px; text-align:center;"> <div class="smart_pdtitle" style=" font-size:14px; color: #fff; border: solid 3px #ffdb6e; font-weight: bold; padding-top: 2px; padding-bottom: 2px; overflow: hidden; height: 34px; background:#ffdb6e; width: 144px;" ><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div> </div> </body> </html>
i'm not using or align="center" because thats not back upwards html5. if remove css max-width 144px, title centered can't set width. if utilize max-width 144px, textbox (smart_pdtitle) float left not centered. how set width textbox (smart_pdtitle) center of box area (smart_pdbox) ?
try adding margin:auto; smart_pdtitle div's inline style attribute.
html5 center box
Comments
Post a Comment