WordPress.org

Ready to get started?Download WordPress

Forums

How do I put a border/divider between post and sidebar? (4 posts)

  1. Evan Mode
    Member
    Posted 1 year ago #

    Hey,
    I just wonder if there's any way to put a thin border/divider between the post and the sidebar? Would greatly appreciate if anyone could help me on this one.
    I use the theme Twenty Ten
    My blog: http://www.evan-mode.com/

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Yes, just add a border-right css reference to the content for class or id.

    Not enough info?

    OK, add this to the very bottom of your style sheet:

    #content {border-right: 2px solid #000}

    This will add a border on right of posts that is 2 pixels wide, a full line (solid) and the color black.

    The width, line type and color can be whatever you want.

    http://www.w3schools.com/css/css_border.asp
    http://www.w3schools.com/css/tryit.asp?filename=trycss_border

  3. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    And here is the code to show such at last link:

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    body
    {
    border-right:2px solid #000;
    }
    </style>
    </head>
    
    <body>
    <p>This is some text in a paragraph.</p>
    <p>This is some text in a paragraph.</p>
    <p>This is some text in a paragraph.</p>
    <p>This is some text in a paragraph.</p>
    </body>
    </html>

    In above, the CSS is applied to the HTML elemental 'body'...it can be applied as a class or id to a div or HTML element such as p, div, page, body, etc or even a p in a div of the body of a page:

    page body div p myclass_or_id_added <===in order it's seen on page.

    ...these are defaults in all compliant browsers but any can have classes or id's applied.

    #content is an id. (the # defined that)

  4. Evan Mode
    Member
    Posted 1 year ago #

    Thank you so much! This really taught me more about borders, its attributes and such. however, it did not give me the effect that I wanted really as the border starts off right after the post, as opposed to be placed in the space between the sidebar and post. Might be hard to explain. I'm gonna read some more and play around, I might resolve it in time.

Topic Closed

This topic has been closed to new replies.

About this Topic