RAM
RAM

Reputation: 11

Give default color for text in html

How do i give default color for text in html ? To explain more in detail...We have dreamweaver or notepad++ or dojo tools or visual studio or any other tool...when we start typing anything..by default it gives color for specified text..Another good example is stack overflow..when some one asks a question...there will be blue color for some text and red for some text and so on...
same like that,i have an web page where when user clicks a button, a message pops up with some html code..so for tags like its should represent one color and content text should be in other color.
hoe do i go about this.?

Thanks in advance

Thanks for reply..Currently we have 5 to 10 lines of html code..but in future as per requirement we might have 1000 or more lines of code..so for each tag i nned to css class ?

Upvotes: 1

Views: 2560

Answers (2)

tHeSiD
tHeSiD

Reputation: 5333

What you can do is have a master css file and include it in all your html pages. In the master css file you define all your html tags so that they represent what you want the users to see. Once you include the master css file in your html page, it will look same as your other pages. This way you dont need to write css in all the files. You will just need to add a link attribute to all your html files.

<LINK href="master.css" rel="stylesheet" type="text/css">

Upvotes: 0

VoteyDisciple
VoteyDisciple

Reputation: 37803

Cascading Style Sheets sound like what you're looking for. You can use CSS to define not only colors, but the entire appearance of your page.

The most basic CSS selectors are just the names of HTML tags, so you could write a simple stylesheet like this:

body {
    color: blue;
}

h1 {
    color: red;
}

p {
    color: purple;
}

Upvotes: 1

Related Questions