/    Sign up×
Community /Pin to ProfileBookmark

Coloring text

I am tyring to color one word out of a Sentence. I want the word Wacky to be red and everything else black.

The sentence is Welcome to Wacky Web Design.

Here is my coding done in dreamweaver.

<html>
<head>

<style>
h1 {font-family:Verdana; font-size:18pt;font-weight:bold; text-align:center;
</style>
<style>
h2 {font-family:verdana; font-size:18pt;font-weight:bold; text-align:center;color:FF0033;}}
</style>

</head>
<body>
<h1>Welcome to<h2>Wacky</h2>Web Design</h1>

</body>
</html>

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@pyroNov 29.2003 — First of all, that is an incorrect use of heading tags. So, I've fixed that, and also fixed the color - you didn't have the # before the hex code.

&lt;style type="text/css"&gt;
h1 {
font-family: Verdana, Arial, Helvetica, sans-serif; /*need to specify a default font*/
font-size: 1.5em; /*pt is for print, not the web*/
font-weight: bold;
text-align: center;
}
h1 span { /*use decendant selectors to set the style for the span inside the h1*/
color: #ff0033;
background: transparent; /*should specify a default font*/
}
&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Welcome to &lt;span&gt;Wacky&lt;/span&gt; Web Design&lt;/h1&gt;
Copy linkTweet thisAlerts:
@newtdaauthorNov 29.2003 — cool thanks for the help.
Copy linkTweet thisAlerts:
@pyroNov 29.2003 — You are welcome. ?
Copy linkTweet thisAlerts:
@newtdaauthorNov 29.2003 — I have another question. I want to put a thin border right below that sentence. i got the border to work, but it goes across the whole page. what is the css codeing make the border shorter than it is?
Copy linkTweet thisAlerts:
@pyroNov 29.2003 — Borders are to be the width of the element, so if you want it smaller, just change the width of the element you are setting it on.
Copy linkTweet thisAlerts:
@newtdaauthorNov 29.2003 — ok now i defantley lost, I am trying to get my border line to fit right under neith the sentence right. here is my coding that i have done so far.


<html>

<head>

<style>

h1 {font-family:Verdana; font-size:18pt;font-weight:bold; text-align:center;}

.color {color: #FF0033; font-size:18pt;}

h2 {font-family:verdana; font-size:18pt;font-weight:bold; text-align:center;border-bottom-style:solid;border-bottom-width:thin; padding:.0cm;}

h3 {font-family:verdana; font-size:16pt;text-align:center}

.bold {font-weight:bold;font-size:18}

h4 {font-family:verdana; font-size:16pt;text-align:center}

</style>

</head>

<body>

<h1>Welcome to<span class="color"> Wacky</span> Web Design</h1>

<h2 class="border"></h2>

<br><h3>Get your<span class="bold"> WEBSITE </span>now for $999.00</h3>

<br>

<h4>Features:</h4>

<br>

<h5></h5>

</body>

</html>


Sorry I am brand new to this stuff and I am not learing it very well.
×

Success!

Help @newtda spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...