Blockquote question

Discussion in 'HTML' started by Samuël van Laere, Oct 10, 2003.

  1. I have the following elements defined in my stylesheet:

    blockquote{
    background-color: #FEFEFE;
    background-image: none;
    border: 1px dotted #DCDCDC;
    color: #A52A2A;
    font: normal 100% serif;
    }

    p {
    background-color: transparent;
    color: #333333;
    font: normal 100% serif;
    }

    I use a HTML Strict doctype and i would like to use the colors defined in
    <blockquote>
    when quoting.

    But why is it that when using it like this:

    <blockquote>
    <p>Some Quote Here</p>
    </blockquote>

    That it will display the border and background color as exspected, but it
    will use the color defined
    for the P element instead of the color defined for Blockquote (color:
    #A52A2A) ??

    Both IE5.5 and the latest Mozilla display the same result.
    Any suggestions?



    --
    With regards,
    Samuël van Laere
    the Netherlands
    http://www.fortron.net
     
    Samuël van Laere, Oct 10, 2003
    #1
    1. Advertising

  2. Samuël van Laere

    Dylan Parry Guest

    Sitting in an ivory tower, Samuël van Laere wrote:

    > <blockquote>
    > <p>Some Quote Here</p>
    > </blockquote>
    >
    > That it will display the border and background color as exspected, but it
    > will use the color defined
    > for the P element instead of the color defined for Blockquote (color:
    > #A52A2A) ??


    Because the text is contained within a <p> and therefore takes on the
    style applied to the <p> and not the <blockquote>[1]. What you need to do
    is create a style rule for <p> elements within <blockquote> elements, eg.

    blockquote > p {
    color: #A52A2A;
    }

    The above says "<p> elements that are children of <blockquote> elements
    should be coloured #A52A2A".

    [1] Well is does take on the blockquote style, but is overridden by the
    style defined for the paragraph.

    --
    Dylan Parry
    http://www.webpageworkshop.co.uk - FREE Web tutorials and references
     
    Dylan Parry, Oct 10, 2003
    #2
    1. Advertising

  3. Samuël van Laere

    brucie Guest

    In post <0hnhb.166380$>
    Samuël van Laere said...

    > blockquote{
    > color: #A52A2A;
    >
    > p {
    > color: #333333;
    >
    > I use a HTML Strict doctype and i would like to use the colors defined in
    > <blockquote>
    > when quoting.
    >
    > But why is it that when using it like this:
    >
    > <blockquote>
    > <p>Some Quote Here</p>
    > </blockquote>
    >
    > That it will display the border and background color as exspected, but it
    > will use the color defined
    > for the P element instead of the color defined for Blockquote (color:
    > #A52A2A) ??


    you said to use "color:#333333;" for all <p> elements. if you want the
    <p> within the <blockquote> to have a different color to the other
    <p>s then use:

    blockquote p{color:#A52A2A;}

    --
    brucie.
    10/October/2003 10:56:15 am
     
    brucie, Oct 10, 2003
    #3
  4. Samuël van Laere

    Dylan Parry Guest

    Sitting in an ivory tower, brucie wrote:

    >> blockquote > p

    >
    > child selectors are not supported by IE (win). a few other browsers
    > have problems as well.


    Cheers for that, brucie. I saw your post straight after and thought that
    there must be a problem with the way I had suggested! I didn't realise
    that, but now I do - cheers again.

    --
    Dylan Parry
    http://www.webpageworkshop.co.uk - FREE Web tutorials and references
     
    Dylan Parry, Oct 10, 2003
    #4
  5. Samuël van Laere

    brucie Guest

    In post <>
    Dylan Parry said...

    > blockquote > p


    child selectors are not supported by IE (win). a few other browsers
    have problems as well.


    --
    brucie.
    10/October/2003 11:03:40 am
     
    brucie, Oct 10, 2003
    #5
  6. "brucie" <> schreef in bericht
    news:...
    > In post <>
    > Dylan Parry said...
    >
    > > blockquote > p

    >
    > child selectors are not supported by IE (win). a few other browsers
    > have problems as well.
    >
    >
    > --
    > brucie.
    > 10/October/2003 11:03:40 am


    Thanks for the help guy's,

    I really need to read more about classes and child selectors, i do not use
    them the correct way.
    As for browsers support for child selectors or lack of it:
    I'll have to try to see what works on what, if Mozilla is happy with it then
    i will be to.



    --
    With regards,
    Samuël van Laere
    the Netherlands
     
    Samuël van Laere, Oct 10, 2003
    #6
  7. "brucie" <> schreef in bericht
    news:...
    > In post <>
    > Dylan Parry said...
    >
    > > blockquote > p

    >
    > child selectors are not supported by IE (win). a few other browsers
    > have problems as well.
    >
    >
    > --
    > brucie.
    > 10/October/2003 11:03:40 am



    Mozilla supports children, another reason to forget about IE for every day
    browsing.


    --
    Regards,
    Samuël
     
    Samuël van Laere, Oct 10, 2003
    #7
  8. Samuël van Laere

    Dylan Parry Guest

    Sitting in an ivory tower, Samuël van Laere wrote:

    > Mozilla supports children, another reason to forget about IE for every day
    > browsing.


    and so it should! If IE was made in the UK, the CSA would be on to it
    before you could say _____ (insert humorous phrase I can't think of).

    --
    Dylan Parry
    http://www.webpageworkshop.co.uk - FREE Web tutorials and references
     
    Dylan Parry, Oct 10, 2003
    #8
  9. "Dylan Parry" <> schreef in bericht
    news:p...
    > Sitting in an ivory tower, Samuël van Laere wrote:
    >
    > > Mozilla supports children, another reason to forget about IE for every

    day
    > > browsing.

    >
    > and so it should! If IE was made in the UK, the CSA would be on to it
    > before you could say _____ (insert humorous phrase I can't think of).
    >


    Very true it should but IE doesn't :(
    MS must be the only company in the world that writes software that is
    getting worse after each update/upgrade
    at least it isn't getting better to say the least.
    What have they done on IE to improve it since 1998? It surely wasn't CSS
    support...
    and yet i still use there products, i must be mad...good thing Mozilla is
    around.


    --
    With regards,
    Samuël van Laere
    the Netherlands
     
    Samuël van Laere, Oct 10, 2003
    #9
  10. Samuël van Laere wrote:

    > As for browsers support for child selectors or lack of it:
    > I'll have to try to see what works on what, if Mozilla is happy with it then
    > i will be to.


    Seriously though. Look into Brucie's suggestion of descendent selectors
    rather than child selectors.

    Child selectors:

    #main > p {
    color: green;
    }
    <div id="main">
    <p>This text is green.</p>
    <div>
    <p>This text may not be green.</p>
    </div>
    </div>

    Descendent selectors:

    #main p {
    color: green;
    }
    <div id="main">
    <p>This text is green.</p>
    <div>
    <p>This text is also green.</p>
    </div>
    </div>

    Child selectors don't work in IE/Win. Descendent selectors *do*.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
     
    Toby A Inkster, Oct 10, 2003
    #10
  11. "brucie" <> wrote in message
    news:...
    > In post <>
    > Dylan Parry said...
    >
    > > blockquote > p

    >
    > child selectors are not supported by IE (win). a few other browsers
    > have problems as well.


    Actually, since IE doesn't support child selectors, and blockquotes quite
    rarely have other tags in them than p, you could as well use

    blockquote p { }

    Bart
     
    Bart van den Burg, Oct 10, 2003
    #11
  12. "Toby A Inkster" <> schreef in bericht
    news:p...
    > Samuël van Laere wrote:
    >
    > > As for browsers support for child selectors or lack of it:
    > > I'll have to try to see what works on what, if Mozilla is happy with it

    then
    > > i will be to.

    >
    > Seriously though. Look into Brucie's suggestion of descendent selectors
    > rather than child selectors.
    >
    > Child selectors:
    >
    > #main > p {
    > color: green;
    > }
    > <div id="main">
    > <p>This text is green.</p>
    > <div>
    > <p>This text may not be green.</p>
    > </div>
    > </div>
    >
    > Descendent selectors:
    >
    > #main p {
    > color: green;
    > }
    > <div id="main">
    > <p>This text is green.</p>
    > <div>
    > <p>This text is also green.</p>
    > </div>
    > </div>
    >
    > Child selectors don't work in IE/Win. Descendent selectors *do*.
    >


    Toby,

    I have looked into it and i'm using it right now.
    didn't even know that IE supported descendent selectors.
    It works on the most used browsers i think.



    --
    With regards,
    Samuël van Laere
    the Netherlands
     
    Samuël van Laere, Oct 10, 2003
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fred Camper
    Replies:
    1
    Views:
    534
    Toby A Inkster
    Aug 7, 2003
  2. William Tasso
    Replies:
    0
    Views:
    394
    William Tasso
    Aug 7, 2003
  3. Adrienne
    Replies:
    25
    Views:
    845
    Fred Camper
    Aug 10, 2003
  4. Sid Ismail
    Replies:
    0
    Views:
    428
    Sid Ismail
    Aug 7, 2003
  5. Spagman
    Replies:
    27
    Views:
    1,584
Loading...

Share This Page