Skip to main content
Participant
Oct 15, 2020 7:05 AM UTC
Question

Style not working

So I'm new to dreamweaver and suddenly my style stopped working. Did i turn something on or off? it works in the body part but when i try to write it in a h or p it just comes up as text or am i just being dumb

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Jon Fritz
Community Expert
Community Expert
Oct 15, 2020 1:17 PM UTC

Take some time to run through these tutorials and make sure you understand the concepts presenteed by using the "Try It Yourself" buttons for each step...

https://www.w3schools.com/html/

https://www.w3schools.com/css/ 

 

...there are a couple of errors within your code that will become very obvious to you after you go through the tutorials. It will also make the code osgood posted make a lot more sense to you.

Translate
Legend
Oct 15, 2020 7:36 AM UTC

You have to write inline css styling like below:

 

<p style="color: red;">Red Text</p>

 

or

 

<h1 style="color: blue;">Blue Text</h1>

 

BUT I would advise against using inline css styles. You should either put the styles in a linked css stylesheet or in the <head></head> section of your pages code, inbetween <style></style> tags:

 

<style>

p {

color: red;

}

h1 {

color: blue;

}

</style>

 

Better still, rather than assigning a generic color to ALL p or h1 tags on your page, you should assign them to specific containers:

 

<div class="product">

<h2>Product 1</h2>

<p>Product description</p>

</div>

 

<style>

.product h2 {

color: red;

}

.product p {

color: blue;

}

</style>

 

Hope that helps. Post back if you have any questions or are trying to do something else.

Translate