Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can CSS affect only a segment of a webpage?

    Is there a way to have a style sheet take effect only over segment of a webpage... say, from the top of a webpage down to the middle of the webpage?... or, from the middle of a webpage down to the bottom?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    In order to have what you require would mean placing the content that you want rendering with CSS in DIV tag container with the appropriate ClassName.

  • #3
    Regular Coder
    Join Date
    Sep 2002
    Location
    self.location
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    a couple of strategies I've considered in the past, but haven't tried out yet:

    I guess you could wrap (for example) the bottom half of the page in a DIV, and use local style declarations within the DIV tag... this would be inherited by the children, but you would be limited to simple declarator:value attribute pairs, and you couldn't target separate tags this way.

    You could also just put an inline STYLE sheet right in the middle of the page, and (I think) it would affect everything thereafter... I've seen this done on some MS pages, but I'm not sure whether it's valid HTML (if that matters to you), or what the side-effects might be.

    There's also the old <plaintext> tag, which apparently nullifies any formatting from the point of its appearance to the end of the page - haven't tried it though.

    ...

    If you're targetting Netscape4, that browser allowed setting styles via javascript dot-syntax. You can declare separate styles any number of times on the page, but the statements must be declared at layout, and can't be modified thereafter. FYI...


  •  

    Posting Permissions

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