Forums

[resolved] how do I style my 2nd template? (17 posts)

  1. oliviaok
    Member
    Posted 4 months ago #

    Hi,

    I have created a 2nd template with the help of Esmi.

    I am having problems styling it. I was hoping it would inherit the css of the main template.

    But is has not, is it possible to configure the 2nd template to inherit the same style as the main?

    Or if I must change the style for 2nd template where do I add the code?

    For example this page is using the 2nd template

    http://www.calligraphycompany.com/handwritten-invitations

    i want to add a margin but as you can see it is hitting the line.

    how would i go about this?

    thanks
    oliviaok

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    Try using Firefox with the Firebug add-on for this kind of CSS work.
    http://getfirebug.com/

  3. oliviaok
    Member
    Posted 4 months ago #

    hi esmi,

    i have the firebug and use it when necessary to play with styling.

    If I implement the style change it will apply to my main template also.

    How to I implement it in my stylesheet to take action against my 2nd template only?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    What classes are being generated on the <body> tag in the markup?

  5. oliviaok
    Member
    Posted 4 months ago #

    I am not sure if I understand your question?

    In my css I have the following:

    #container
    #content

    In my 2nd template i have:

    </div><!-- #container -->

  6. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    Look at the generated markup for your new custom page template. What classes are being generated on the <body> tag?

  7. oliviaok
    Member
    Posted 4 months ago #

    Custom template:
    http://pastebin.com/cDdxjkcv

    sorry not 100% with terminology

  8. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    No - we need to see a page using this template.

  9. oliviaok
    Member
    Posted 4 months ago #

    Oh right, i have it in use on this page:

    http://www.calligraphycompany.com/handwritten-invitations

  10. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    You can selectively style that page by using body.page-template-onesidebar-php before all of your custom style selectors.

  11. oliviaok
    Member
    Posted 4 months ago #

    do you mean like this for example:

    #container.page-template-onesidebar-php
    {
    blah blah blah....
    }

  12. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    No. Try:

    body.page-template-onesidebar-php #container {
    }
  13. oliviaok
    Member
    Posted 4 months ago #

    hi Esmi,

    tried as you said, but did not work:

    body.page-template-onesidebar-php #container {
    	margin-left: 220px;
    }
  14. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    That's probably because you don't actually have a div with an id of container in your theme! You need to use ids and classes that are actually in the page markup.

  15. oliviaok
    Member
    Posted 4 months ago #

    Oh dear, how do I do that?

  16. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    That's what Firebug is for. You can inspect any element and see what CSS is being used on it.

  17. oliviaok
    Member
    Posted 4 months ago #

    yes your right.

    thanks a lot, ive managed to work it out!

Reply

You must log in to post.

About this Topic