Results 1 to 10 of 10

Thread: Change colour of a specificlLi field

  1. #1
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default Change colour of a specificlLi field

    Here is the page in question.
    http://www.theremotedoctor.co.uk/acc...llto=selection

    I am trying to edit the background colour with the details shown below but not going to plan.

    Code:
    <li class="licenter"><a href="#home" class="scroll">Return to Menu</a></li>
    Code:
    li.licenter {
        text-align: center;
        color: #440000;
    	background-color: #000000;
    Can you advise where i have gone wrong please.

    #000000 will be changed later,only used it so i could see the code has worked "still waiting for that bit"
    Last edited by theremotedr; 05-23-2015 at 09:24 AM.

  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there theremotedr,

    the "background-color" in question is controlled here...

    Code:
    
    #secondary-navigation ul li a { 
    	background:#E6E6E6;
    	display:block;
    	margin:5px 0; 
    	padding:10px;
    	text-decoration:none;
            border-style: solid;
            border-width: 1px;
    	border: #5d0e13;
    	box-shadow:#000 4px 4px 8px
     }
    
    
    #secondary-navigation ul li a:hover,
    #secondary-navigation ul li.current a {
    	background:#0099ff;
    	color:#fff;
     }

    coothead
    ~ the original bald headed old fart ~

  3. The Following User Says Thank You to coothead For This Useful Post:

    theremotedr (05-23-2015)

  4. #3
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    Hi
    That changes all the fields.
    I am looking to just change the colour of a specific field "Return To Menu"

  5. #4
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there theremotedr,

    in that case use this...
    Code:
    
    .scroll{
        background-color:#000!important;
        color:#f00!important;
     }
    .scroll:hover{
        background-color:#f00!important;
        color:#000!important;
     }

    coothead
    ~ the original bald headed old fart ~

  6. The Following User Says Thank You to coothead For This Useful Post:

    theremotedr (05-23-2015)

  7. #5
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    I am a Newbie with all this so if I can have a look tomorrow and advise here if I get stuck.

    Thanks very much.

  8. #6
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    Hi,
    I have applied that to all the pages and pretty good.
    One thing that i have noticed is with the standard class="scroll" applied it glides to the top nicely.
    With this .scroll applied it jumps there.

    Can it be altered so it glides smoothly.

    Many thanks

  9. #7
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there theremotedr,

    it does not scroll to ther top smooooooothly because you have changed this...

    Code:
    
    <li class="licenter"><a href="#home" class="scroll">Return to Menu</a></li>
    ...to this...

    Code:
    
    <li class="licenter"><a href="#home" class="rtmscroll">Return to Menu</a></li>

    coothead
    ~ the original bald headed old fart ~

  10. The Following User Says Thank You to coothead For This Useful Post:

    theremotedr (05-23-2015)

  11. #8
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    Morning,
    I added the rtm so it would be unique to the Li in question only and not any other scroll that was on the site.
    Learning all this i thought it was what i need to do.
    I have since put it back to scroll.

  12. #9
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    Two alternatives. Add a new class (any object can belong to more than one class), or give your object an "id". Remember that there can only be one object with that "id" in the page, but I think that's what your want anyway.

    You will need to add some extra code to your CSS file.

    Code:
    <li class="licenter"><a href="#home" class="scroll rtm">Return to Menu</a></li>
    
    .rtm{
        background-color:#000!important;
        color:#f00!important;
     }
    .rtm:hover{
        background-color:#f00!important;
        color:#000!important;
     }
    Code:
    <li class="licenter"><a href="#home" id="rtm" class="scroll">Return to Menu</a></li>
    
    #rtm{
        background-color:#000!important;
        color:#f00!important;
     }
    #rtm:hover{
        background-color:#f00!important;
        color:#000!important;
     }

  13. The Following User Says Thank You to styxlawyer For This Useful Post:

    theremotedr (05-23-2015)

  14. #10
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    Hi,
    I think i will use your second example.

    Can you advise please.
    Here is the page.
    http://www.theremotedoctor.co.uk/victorias_attic.html

    I need to apply the code to the field Return To Remote Doctor Site BUT no have it scroll as its a link to my sites index page.
    How would i write it up.
    Currently as below.
    Code:
    <li class="licenter"><a href="index.html" >Return to Remote Doctor Site</a></li>
    Thanks for your input

Similar Threads

  1. CSS weekday colour change
    By moose86 in forum CSS
    Replies: 1
    Last Post: 05-26-2011, 02:56 PM
  2. Resolved How to change Backgound colour
    By hariprasad in forum CSS
    Replies: 4
    Last Post: 05-10-2010, 03:09 PM
  3. Text Colour Change
    By djohno24 in forum HTML
    Replies: 7
    Last Post: 03-02-2009, 11:08 PM
  4. How to change the colour of the menu?
    By srkssit in forum PHP
    Replies: 2
    Last Post: 01-14-2009, 12:24 PM
  5. change the colour of website...
    By queerfm in forum CSS
    Replies: 5
    Last Post: 07-07-2006, 05:19 PM

Bookmarks

Posting Permissions

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