Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2008
    Posts
    112
    Thanks
    32
    Thanked 0 Times in 0 Posts

    CSS styles mixup

    I waste more time trying to figure out problems in this vein than anywhere else.

    I've created a style:

    Code:
    .ws {
    	background:url(http://woodensun.com/wp-content/uploads/2014/02/WS-logo-bullet-point.png) no-repeat;
    	margin-left: 5px;
    	padding: 0 0 5px 15px;
    	list-style-type:none;
    	}
    then tried to apply it to a bulleted list, but the (native theme) style list is already:

    Code:
    .entry-content ul li {
           list-style-type: disc;
           margin: 0 0 0 30px;
           padding: 0 0 7px 0;
    }
    No matter how I try to combine the styles:

    .ws .entry-content ul li
    .ws.entry-content ul li
    .entry-content .ws ul li
    .entry-content ul li.ws

    ...I can't f%#^^#!! get it to overwrite the native style.

    Can anyone straighten me out here?

    Retractable Canopies Charlottesville, Richmond, VA - Wooden Sun

    Thanks,

    John

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,702
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    First of all, it would be better if you applied the class “ws” to the list (ul), not each list item.
    Secondly, .entry-content .ws {…} appears to work for me.

  • #3
    Regular Coder
    Join Date
    Jul 2008
    Posts
    112
    Thanks
    32
    Thanked 0 Times in 0 Posts
    Per your suggestion, the (combined) style now is:

    .entry-content .ws ul li {
    background:url (http://woodensun.com/wp-content/uplo...llet-point.png) no-repeat;
    margin-left: 5px;
    padding: 0 0 5px 15px;
    list-style-type: none;
    }

    and my list is:

    <ul class="ws">
    <li class="ws">Retractable ...</li>
    <li class="ws"> ... </li> , etc.

    It's still defaulting to .entry-content ul li, my .ws is not coming in. - ??

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello johndove523,
    I'm not sure applying the .ws to both ul and li is really the way to go.
    Also, in your CSS calling that ul.ws makes more sense than ul .ws ...

    Look at it this way once -
    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	margin: 0;
    	font: 100% "Trebuchet MS", Arial, Helvetica, sans-serif;
    	color: #000;
    	background: #fc6;
    }
    .entry-content {
    	width: 800px;
    	margin: 0 auto;
    	background: #999;
    }
    .entry-content ul li {
    	list-style-type: disc;
    	margin: 0 0 0 30px;
    	padding: 0 0 7px 0;
    }
    .entry-content ul.ws li {
     	background: url(http://woodensun.com/wp-content/uplo...llet-point.png)no-repeat;
    	margin-left: 5px;
    	padding: 0 0 5px 15px;
    	list-style-type: none;
    }
    </style>
    </head>
    <body>
    	<div class="entry-content"> 
    		<ul class="ws">
    			<li>Retractable ...</li>
    			<li>Retractable ...</li>
    			<li>Retractable ...</li>
    			<li>Retractable ...</li>
    		</ul>
    	<!--end .entry-content--></div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    johndove523 (04-16-2014)

  • #5
    Regular Coder
    Join Date
    Jul 2008
    Posts
    112
    Thanks
    32
    Thanked 0 Times in 0 Posts
    Excavator,

    style is now:
    Code:
    .entry-content ul.ws li {
    	background:url(http://woodensun.com/wp-content/uploads/2014/02/WS-logo-bullet-point.png) no-repeat;
    	margin-left: 5px;
    	padding: 0 0 5px 15px;
    	list-style-type: none;
    	}
    and list is:

    Code:
    <div class="entry-content"> 
    		<ul class="ws">
    			<li> ...</li>
                    </ul>
             </div>
    still doesn't work. (??)

  • #6
    Regular Coder
    Join Date
    Jul 2008
    Posts
    112
    Thanks
    32
    Thanked 0 Times in 0 Posts
    Fixed. Sorry, a couple of things were wrong. First, the .css wasn't transferring from local to server. Second, they can't put a bulleted list in between cris-crossed (float:left, float:right) pics like that.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •