Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Blockquote question

Reply
Thread Tools

Blockquote question

 
 
SamuŽl van Laere
Guest
Posts: n/a
 
      10-10-2003
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


 
Reply With Quote
 
 
 
 
Dylan Parry
Guest
Posts: n/a
 
      10-10-2003
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
 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      10-10-2003
In post <0hnhb.166380$(E-Mail Removed)>
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
 
Reply With Quote
 
Dylan Parry
Guest
Posts: n/a
 
      10-10-2003
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

 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      10-10-2003
In post <(E-Mail Removed)>
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
 
Reply With Quote
 
SamuŽl van Laere
Guest
Posts: n/a
 
      10-10-2003
"brucie" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> In post <(E-Mail Removed)>
> 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


 
Reply With Quote
 
SamuŽl van Laere
Guest
Posts: n/a
 
      10-10-2003

"brucie" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> In post <(E-Mail Removed)>
> 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


 
Reply With Quote
 
Dylan Parry
Guest
Posts: n/a
 
      10-10-2003
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
 
Reply With Quote
 
SamuŽl van Laere
Guest
Posts: n/a
 
      10-10-2003
"Dylan Parry" <(E-Mail Removed)> schreef in bericht
news(E-Mail Removed) ...
> 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



 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      10-10-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
css question, blockquote/li tags Spagman HTML 27 07-18-2004 05:09 PM
Re: Avoiding double spacing before a blockquote Adrienne HTML 25 08-10-2003 01:29 AM
Avoiding the double space before a blockquote Fred Camper HTML 1 08-07-2003 06:41 AM
Re: Avoiding double spacing before a blockquote William Tasso HTML 0 08-06-2003 11:50 PM
Re: Avoiding double spacing before a blockquote Sid Ismail HTML 0 08-06-2003 11:44 PM



Advertisments