more than one style on same line

S

shank

How can I convert this to be CSS compliant?
As I understand it, the <s> is deprecated.
If I add <p> tags, it won't all be on one line.

<div style="font:bold 18px; color:#CC0000">
<s>REG PRICE $325.00</s>&nbsp;&nbsp;NOW ONLY $295.00!!!
</div>

Also, is there a way to control the width of the strikethrough line?
I want a thicker line if possible.

thanks
 
M

mark | r

<div style="font:bold 18px; color:#C00">
<span style="text-decoration: line-through;margin-right:10px">REG PRICE
$325.00</span>NOW ONLY $295.00!!!
</div>
 
S

shank

mark | r said:
<div style="font:bold 18px; color:#C00">
<span style="text-decoration: line-through;margin-right:10px">REG PRICE
$325.00</span>NOW ONLY $295.00!!!
</div>

thanks! I thought there was a problem using <span> in there. My mistake.

Is there a way to control the width of the line itself?
thanks!
 
J

Jukka K. Korpela

shank said:
How can I convert this to be CSS compliant?

The style sheet "font:bold 18px; color:#CC0000" is CSS compliant except
that the font shorthand must contain a value for font-family. It still
does not make sense, though, since you set font size in pixels and set
color without setting background. A good CSS checker would have (more
or less) told you this rather fast.
As I understand it, the <s> is deprecated.

Yes, in HTML 4. This has nothing to do with CSS compliance, though.
If I add <p> tags, it won't all be on one line.

It depends where you add them and whether you have relevant CSS rules.
But if it's a problem, why do you add them?
<div style=>
<s>REG PRICE $325.00</s>&nbsp;&nbsp;NOW ONLY $295.00!!!
</div>

What's that? I've learned that triple exclamation marks are a sure sign
of trying to fool customers, but there's nothing in CSS or HTML
specification that prevents that, or SHOUTING.
Also, is there a way to control the width of the strikethrough line?

No. You could simulate one by using a suitably positioned border, but
it's really not worth the effort.

Why don't you just tell what you are trying to present? What's wrong
with something like the following?

<div><strong>Now only $295.</strong> (Regular price: $325.)</div>

Why would you strike out the regular price, making it harder to see
what it is and thereby appreciate the bargain (if it is one)?

You could add some styling to <strong>, of course.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top