#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Specially Formatting Homepage


    Hi all,
    Fairly new to the CSS world. I'm editing my website through a Webnode template and can't figure out how to change things on one page (ie- remove the header from the homepage) without it applying to all other pages. I'd like to completely re-format the homepage to look less like a template but can't get the changes to apply only to that page. Is it possible to do this?

    thanks!!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    50

    Specify specific CSS after general CSS


    Yes, you can do it. There are a few possibilities.

    I assume from your description that you have a common CSS file determining format of your pages in general and that you include it in your pages something like this:

    PHP Code:
    <html>
    ...
    <
    link rel="stylesheet" type="text/css" href="common.css" />
    ...
    </
    html
    If there isn't a lot of CSS to change the look of the home page, you can just put the changes in an in-page style sheet after you include the common.

    PHP Code:
    <html>
    ...
    <
    link rel="stylesheet" type="text/css" href="common.css" />
    <
    style type="text/css">
    /* custom CSS here */
    </style>
    ...
    </
    html
    Or, to keep the CSS separate, just include the CSS that has the local variations after the common CSS.

    PHP Code:
    <html>
    ...
    <
    link rel="stylesheet" type="text/css" href="common.css" />
    <
    link rel="stylesheet" type="text/css" href="homepage.css" />
    ...
    </
    html

    The key is that you keep the specific stuff after the general stuff.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    No full html access


    Sadly, because of the hosting site I'm using, I don't have access to the full html code, just the full CSS code and the content-specific html code.

    Any ideas?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    50
    Originally Posted by mkeenan
    Sadly, because of the hosting site I'm using, I don't have access to the full html code, just the full CSS code and the content-specific html code.

    Any ideas?
    That's kind of a trade off you made.... If you want full control, you'll need a configuration that gives you full control. So if it is very important to you a change of host (or plan) is an obvious option.

    You are implying that you can't insert your own CSS link into the <head> section. You could try putting it in to the first location you have available to you in the HTML. Although, that's too late for changing the "body" or anything that comes before where ever your CSS gets inserted.

    Do you have the ability to surround your content in a <div>? You can then give the <div> an id and create CSS specific (in the main CSS) to items contained in the div.

    Lastly, these aren't likely, but maybe you can try looking at the HTML and see if there are already identifying div's that you can control in the main CSS. E.g., if the main page happens to be surrounded by a "div" with an ID like "main-page" change that. Or if the main page has a different structure, you might be able to take advantage of that.

IMN logo majestic logo threadwatch logo seochat tools logo