1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I Need Some CSS Help...

Discussion in 'CSS' started by WallerBlog, Dec 21, 2008.

  1. #1
    I need a CSS guru to lend me a hand.

    I have a blog that I've just recently started up. I am using a slightly modified version of the Lifestyle theme from Revolution 2. A sample of the theme can be found here. The CSS file can be found here.

    I like the color palette of the theme. However, I would like the color of the links in the posts to be the normal #0000FF. I've tried creating a separate class for this and inserting it in various areas of the template. However, so far I haven't had any luck.

    Can someone take a peek at the source of that template and tell me how I would do this?

    Thanks!
     
    WallerBlog, Dec 21, 2008 IP
  2. islandhopper8

    islandhopper8 Active Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #2
    In your stylesheet "style.css" change the following to (line 42)"

    /************************************************
    *	Hyperlinks									*
    ************************************************/
    
    a, a:visited {
    [B]	color: #0000ff;[/B]
    	text-decoration: none;
    	}
    Code (markup):
    That will change the links to the blue color.
     
    islandhopper8, Dec 21, 2008 IP
  3. WallerBlog

    WallerBlog Peon

    Messages:
    157
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I understand how to change the link color of all links. However, what I am needed is to only change the color of the links within the individual posts themselves. All sidebar, comment and footer links should stay the color that they currently are.
     
    WallerBlog, Dec 21, 2008 IP
  4. islandhopper8

    islandhopper8 Active Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #4
    I just changed one of the links in the blog as follows:
    On the end of the style sheet I added the following code;
     .inbloglinks {
    	color: #0000FF;}
    
    Code (markup):
    By the hyperlink I added

    <a class="inbloglinks" href="http://www.revolutiontwo.com/demo/lifestyle/category/beauty" 
                                    rel="category tag" title="View all posts in Beauty">Beauty</a>,
    Code (markup):
    And it show only this link blue.

    Hope this is what you are looking for.
     
    islandhopper8, Dec 21, 2008 IP
  5. thundercow

    thundercow Well-Known Member

    Messages:
    246
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #5
    you need to put this in your css file because the class you are designating ".inbloglinks", needs to also be designated as a link--you have simply designated a color for plain text with no link.


    .inbloglinks, .inbloglinks a {
    color: #0000FF;}

    --try that
     
    thundercow, Dec 22, 2008 IP
  6. WallerBlog

    WallerBlog Peon

    Messages:
    157
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I gave that a shot and no luck. It seems that the color given in the hyperlinks section is overriding the new class I've entered.

    In the CSS file I have

    /************************************************
    *	Content 					     		    * 
    ************************************************/
    
    #content {
    	width: 940px;
    	margin: 0px auto 0px;
    	padding: 10px 0px 0px 0px;
    	line-height: 18px;
    	}
    
    .inbloglinks, .inbloglinks a {
            color: #0000FF;
            }
    Code (markup):


    In the index.php I have

                        <div id="post">
                                    <div id="inbloglinks">
    			<?php the_content(__('Read more'));?><div style="clear:both;"></div>
    			        </div>
                                    </div>
    Code (markup):
    Am I missing something?
     
    WallerBlog, Dec 22, 2008 IP
  7. Muism4t

    Muism4t Active Member

    Messages:
    114
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #7
    .class{}
    #uniqueid{}

    <div id="uniqueid">Use this only once</div>
    <div class="class">Use this multiple times</div>
    <div class="class">Use this multiple times</div>


    Don't confuse classses and id's.
     
    Muism4t, Dec 22, 2008 IP
  8. islandhopper8

    islandhopper8 Active Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #8
    Also to get the links changed it is best to change the class of the link you want to change. This works best.

    However the area you want the style to apply to is called "postarea"

    So adding this to the stylesheet should solve it for you, if you dont want to put a class to the individual links:

    .postarea  a,.postarea  a:vistited {
    	color: #0000FF;
    	
    }
    
    Code (markup):
     
    islandhopper8, Dec 22, 2008 IP
  9. WallerBlog

    WallerBlog Peon

    Messages:
    157
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Still no dice.

    Removed .inbloglinks class in the CSS file and the call in the index.php

    Added

    .postarea {
    	background: #FFFFFF url(images/homepagetop.gif) top no-repeat;
    	float: left;
    	width: 590px;
    	margin: 0px 0px 10px 0px;
    	padding: 10px;
    	border: 1px solid #DDDDDD;
    	}
    
    .postarea  a, .postarea  a:vistited {
    	color: #0000FF;
    	}
    Code (markup):
    It seems like this section at the top of the CSS file is overriding everything else.

    /************************************************
    *	Hyperlinks									*
    ************************************************/
    
    a, a:visited {
    	color: #7A3254;
    	text-decoration: none;
    	}
    	
    a:hover {
    	color: #495D5C;
    	text-decoration: underline;
    	}
    Code (markup):
     
    WallerBlog, Dec 22, 2008 IP
  10. islandhopper8

    islandhopper8 Active Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #10
    I have copied the code into my developer and it works in IE, however I just checked it seems not to work in Firefox let me have a look at it. I presume you are using Firefox as browser.
     
    islandhopper8, Dec 22, 2008 IP
  11. islandhopper8

    islandhopper8 Active Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #11
    Do the following:
    in the hyperlink section of your css stylesheet add
    p a,p a:visited{
    	
    	color:#0000ff;
    }
    
    Code (markup):
    This shows by me the blue color for the posts in FF and IE and leaves all the site links in the original color.

    Let me know if this worked for you.
     
    islandhopper8, Dec 22, 2008 IP
    WallerBlog likes this.
  12. WallerBlog

    WallerBlog Peon

    Messages:
    157
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Bingo! That did it.

    I assume that this will change the link color of anything encased in <p> tags?

    If so, the only issue I have is that the author, tags and comment link at the top of the post are encased in <p> tags as are the comments at the end of the post. If possible I'd rather leave these the default link color and only have the links within the post itself #0000FF.

    If this isn't possible without rewriting large pieces of code, then no worries. I'm very grateful for your help so far.

    +Rep!
     
    WallerBlog, Dec 22, 2008 IP
  13. islandhopper8

    islandhopper8 Active Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #13
    If that is the case just add a class to those links like
    
    .speciallink a, .speciallink a:visited
    {
    color:#495D5C;
    }
    
    Code (markup):
    <a class="speciallink" href="#">author</a>
    HTML:
    That should keep the right color.
     
    islandhopper8, Dec 22, 2008 IP
  14. WallerBlog

    WallerBlog Peon

    Messages:
    157
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I took your suggestion and changed it slightly.

    I needed the tags, author, date and comments to be the default color. To do this, I created a special class for each section.

    .date a, .date a:visited {
            color: #7A3254;
    	text-decoration: none;
    	}
    
    .postmeta a, .postmeta a:visited {
            color: #7A3254;
    	text-decoration: none;
    	}
    
    .comments a, .comments a:visited {
            color: #7A3254;
    	text-decoration: none;
    	}
    Code (markup):
    Works perfectly. The page is exactly how I wanted it.

    Thanks again for your help.
     
    WallerBlog, Dec 22, 2008 IP
  15. islandhopper8

    islandhopper8 Active Member

    Messages:
    100
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #15
    Your welcome :) I am glad that you got it finally all worked out.
     
    islandhopper8, Dec 22, 2008 IP