html - Why style a lists -
what point in styling ul? have following html structure
<div id='container'> <div id='ui' class='quad'> <div class='quadnav'> <span class='quadtitle'>urgent , important</span> <i class="fa fa-plus fa-2x addbutton"></i> </div> <ul class='tasklist'> <li>test</li> <li>test2</li> </ul> </div>
and following css styling list
.tasklist{ } .tasklist li{ list-style-type:none; position:relative; top:2em; left:1.2em; }
with .tasklist section empty li elements style want them to. if remove .tasklist section, li's no longer style. gives? supposed go styling of ul element vs li element, don't understand.
edit may not have worded question, have following css
<style> /* -------- general styling ---------*/ *{ margin:0; padding:0; } html, body { font-size:20px; } #container{ width:100%; height:100%; position:absolute; top:0; left:0; } /*--------quadrant style ------- */ .quad{ position: relative; width: 49.85%; height: 49.8%; font-size: .8em; border: solid 1px black; } #ui{ float: left; background-color: green; } #nui{ float: right; background-color: red; } #uni{ float: left; background-color: blue; } #nuni{ float:right; background-color:yellow; } /*------- quadrant navigation styling ------- */ .quadnav{ position:relative; width:100%; top:1em; } .quadtitle{ position: relative; left:1em; } .addbutton{ position:relative; float:right; right: 1em; } /*---------- task list styling ----------*/' .tasklist{ } .tasklist li{ list-style-type:none; position:relative; top:2em; left:1.2em; }
when remove empty .tasklist{} declaration .tasklist li styles stop working. trying figure out why.
this happen if have error in preceding css, e.g.
.broken { /* note no closing brace */ .tasklist{ } .tasklist li{ list-style-type:none; position:relative; top:2em; left:1.2em; }
now, .tasklist {
line inside .broken {...} block
, , closing brace .tasklist
closes that, following .tasklist li {
block works ok. if remove .tasklist
block, wind .tasklist li
styling inside erroneous block, , styling stops working.
edit: in updated code, can see problem stray apostrophe on line
/*---------- task list styling ----------*/'
remove trailing '
, fix it
Comments
Post a Comment