• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Style not working

New Here ,
Oct 15, 2020 Oct 15, 2020

Copy link to clipboard

Copied

Jet5CDF_0-1602745432391.png

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

TOPICS
Code

Views

142

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 15, 2020 Oct 15, 2020

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 15, 2020 Oct 15, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines