Help with CSS selector for a totally CSS-clueless person

RalphTheCow

Senior member
Sep 14, 2000
978
393
136
I want to apply a personal style to this HTML snippet:

<p><center><font color="#cc0000"><strong>Note:</strong> Remember that this is only a preview, and has not yet been saved!</font></center></p>

Based on advice from someone, I am trying to use a selector of:
p>center>font>strong to style that text, as follows:

p>center>font>strong { font-size: larger; text-decoration: blink; }

But it doesn't seem to work. When I look up CSS selectors, I never see a syntax like I am trying to use.

Am I even close? This is in Wikipedia, BTW.
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
If I remember correctly, this selector doesn't work on all browsers..

Why can't you do this:

<p style="text-align: center; color: #cc0000; font-size: 1.2em;"><span style="font-weight: bold;">Note:</span> Remember that this is only a preview, and has not yet been saved!</p>

Please don't use blink :( It's the most annoying thing evar!! You can always pull out the CSS properties in my example and stick in another file..

I know my solution don't exactly answer your question.. but I believe it's a cleaner way to do it.
 

RalphTheCow

Senior member
Sep 14, 2000
978
393
136
That just looks like HTML to me. I thought the syntax of CSS was selector {properties}. And only I will see the blinking - it is to remind me to save when editing something in Wikipedia.

My original doesn't work in either Firefox or IE.
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Originally posted by: RalphTheCow
That just looks like HTML to me. I thought the syntax of CSS was selector {properties}. And only I will see the blinking - it is to remind me to save when editing something in Wikipedia.

My original doesn't work in either Firefox or IE.

The code that I have on top is HTML, and whatever's inside "style" are CSS properties. I am not using selectors in this example because.. well duh.. the properties are already inside the tag, so it only affects this tag and its child elements.

You can pull out the CSS properties inside "style" and put it as selector {properties}.

Actually I don't see what you are trying to do.. are you trying to format the content in wikipedia? Don't they already have special tags to mark-up text.. :confused:
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Not sure if you *need* spaces around your greater than signs, but it's worth a shot. I don't think I've ever seen anyone omit those spaces.
 

RalphTheCow

Senior member
Sep 14, 2000
978
393
136
Yes, exactly, BBWF. I want the warning note that it's only a preview to be big and flash so I am less likely to miss it. I'll try with the spaces and then report back.

Made no difference. Man, this shouldn't be this hard!
 

RalphTheCow

Senior member
Sep 14, 2000
978
393
136
I've made some progress! But it appears that the font color part of the selector is what's not working:

p > center > font color="#cc0000" { font-size: 200%; text-decoration: blink; }

If I omit the font color part, the whole page gets a smaller font! So at least something is happening, even though not what I want!

So I should try
p > center > font color="#cc0000" { font-size: 200%!importnant; text-decoration: blink!important; } ?

This finally did it!

center { font-size: 200%; text-decoration: blink; }

It will make all centered text big and flashing, but so far it has only been the red text I want. I had to really nail the browser refresh many times to get it to work.