soltek Posted April 25, 2011 Share Posted April 25, 2011 Hey there, using this code the div 'ts' shouldnt be just wide enough to accomodate the words? Like auto width or something. The thing is, no matter what I do, the div extentds itself @ 100% my screen's wideness. Where did I messed up this time? Thanks. HTML: <div id="menu"> <div class="items"> <div class="ts"> Hello World! </div> </div> </div> CSS: #menu { padding-top: 5px; width: 100%; height: 35px; background-image: url('imagens/menu-fundo.png'); background-repeat: repeat-x; box-shadow: 3px 3px 7px #000; } #menu .items { height: 20px; position:absolute. padding-bottom: auto; font-weight: bold; color: red; } .ts{ color: white; box-shadow: 3px 3px 7px #000; width: auto; } Link to comment https://forums.phpfreaks.com/topic/234626-stuborn-div/ Share on other sites More sharing options...
sunfighter Posted April 25, 2011 Share Posted April 25, 2011 You should set the width. Control the div, don't let it control you. A link to the width values and what they do. http://www.w3schools.com/css/pr_dim_width.asp PS. set width: 100px; example. Link to comment https://forums.phpfreaks.com/topic/234626-stuborn-div/#findComment-1205974 Share on other sites More sharing options...
soltek Posted April 26, 2011 Author Share Posted April 26, 2011 You should set the width. Control the div, don't let it control you. A link to the width values and what they do. http://www.w3schools.com/css/pr_dim_width.asp PS. set width: 100px; example. Damn, I forgot abouth this thread. I ended up using spans. Thanks anyway, mate. Link to comment https://forums.phpfreaks.com/topic/234626-stuborn-div/#findComment-1206543 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.