How to use css in simple HTML application

How to use css in simple HTML application

Please give simple example for understanding purpose

View Answers

March 16, 2012 at 8:22 PM

<html>
<head>
<style type="text/css">
p { color:red;}
</style>
</head>
<body>
<p>
This is normal paragraph text 
</p>
</body>
</html>

CSS is usually used when you want to separate the webpage's content and all the formatting stuff.

To use CSS in you're webpage, you must set the style type as " text/css" within the 'head' tag.

<head>
<style type="text/css">

</style>
</head>


while all the CSS code should be typed within the style tag.

Now the syntax goes something like this :
element { property : value;}

In the above example, I used the 'color' property to change the font color of contents under the 'p' tag a.k.a element to red.

p { color:red;}

Ads









Related Tutorials/Questions & Answers:
How to use css in simple HTML application
How to use css in simple HTML application   Please give simple example for understanding purpose
HTML CSS example
HTML CSS example  Hi, Can anyone share the HTML CSS example code. I my HTML web page I have to embed the CSS style. Share some HTML CSS example with me. Thanks   Hi, You can use the following code to define CSS
Advertisements
Include CSS in HTML
Include CSS in HTML  Can any one tell me how to include a CSS file into my HTML page. A code format to include the CSS will work. Thanks in Advance.   Include CSS in HTML To include a CSS or Style Sheet into you HTML
How to create simple HTML Form?
HTML Form Tutorial: How to create simple HTML Form? In web application input... application. In this tutorial you will learn to create simple HTML form for taking... on the website. How to create simple HTML Form? Now we will create our simple HTML
What is HTML 5 and CSS 3
and mobile application at present time. As we have already learned that HTML 5 and CSS...What is HTML 5 and CSS 3 HTML 5 and CSS 3 are the standard versions of the basic HTML and CSS language, which is used to create more interactive web pages
ModuleNotFoundError: No module named 'css-html-js-minify'
named 'css-html-js-minify' How to remove the ModuleNotFoundError: No module named 'css-html-js-minify' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'css-html-js-minify'  Hi, My
ModuleNotFoundError: No module named 'css-html-js-minify'
named 'css-html-js-minify' How to remove the ModuleNotFoundError: No module named 'css-html-js-minify' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'css-html-js-minify'  Hi, My
ModuleNotFoundError: No module named 'css-html-js-minify'
named 'css-html-js-minify' How to remove the ModuleNotFoundError: No module named 'css-html-js-minify' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'css-html-js-minify'  Hi, My
ModuleNotFoundError: No module named 'css-html-prettify'
named 'css-html-prettify' How to remove the ModuleNotFoundError: No module named 'css-html-prettify' error? Thanks   Hi, In your...ModuleNotFoundError: No module named 'css-html-prettify'  Hi, My
Java HTML Client Application
Java HTML Client Application  Java HTML Client Application
How to add background image to div using CSS?
How to add background image to div using CSS
Simple HTML example
Simple HTML example In this section we will give you very simple example of a HTML page. After reading this page you should be able to create simple HTML... can use HTML with JavaScript to create more dynamic WebPages. These days HTML
how to use ajax in html file
how to use ajax in html file  <!DOCTYPE html PUBLIC "-//W3C//DTD...; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <..." /> <meta http-equiv="Content-Type" content="text/html; charset
How to create simple HTML Login Page?
to create simple login form in HTML. The login form is further validated with JavaScript. You will  learn How to create a simple HTML login page...Simple HTML Login Page- Create a Simple HTML Login page and validate
How to create simple HTML Login Page?
to create simple login form in HTML. The login form is further validated with JavaScript. You will  learn How to create a simple HTML login page...Simple HTML Login Page- Create a Simple HTML Login page and validate
ModuleNotFoundError: No module named 'simple-html'
'simple-html' How to remove the ModuleNotFoundError: No module named 'simple-html' error? Thanks   Hi, In your python environment...ModuleNotFoundError: No module named 'simple-html'  Hi, My Python
Simple application using hibernate
Simple application using hibernate  Hi, How to write a simple application using hibernate in Eclipse IDE? I would like to to learn: Process... of the tutorial you will like to learn for creating the simple application using
how to extract css properties using java?
how to extract css properties using java?  how to extract css properties using java
How to align div side by side?
Example of aligning DIV side by side in HTML page In this tutorial I will explain you how you can align the div side by side using CSS. The CSS...; margin:5px; } </style> In the above CSS we have use the float:left
java spring simple application
java spring simple application  hai I have design a simple application in this I always found class not found exception. I am sendig code as follows please resolve this and send me.my directory structure is as follows Project
ModuleNotFoundError: No module named 'python-simple-html-sanitize'
: No module named 'python-simple-html-sanitize' How to remove the ModuleNotFoundError: No module named 'python-simple-html-sanitize' error? Thanks...ModuleNotFoundError: No module named 'python-simple-html-sanitize'  
Maven dependency for com.globalmentor - globalmentor-css version 0.6.5 is released. Learn to use globalmentor-css version 0.6.5 in Maven based Java projects
is 0.6.5. Developer can use this version ( com.globalmentor - globalmentor-css version... - globalmentor-css in your Maven/Gradle project. Step 1: Create or use a Maven... - globalmentor-css version 0.6.5 Now the next step is to use the latest
Maven dependency for com.globalmentor - globalmentor-css version 0.6.3 is released. Learn to use globalmentor-css version 0.6.3 in Maven based Java projects
is 0.6.3. Developer can use this version ( com.globalmentor - globalmentor-css version... - globalmentor-css in your Maven/Gradle project. Step 1: Create or use a Maven... - globalmentor-css version 0.6.3 Now the next step is to use the latest
Maven dependency for com.globalmentor - globalmentor-css version 0.6.4 is released. Learn to use globalmentor-css version 0.6.4 in Maven based Java projects
is 0.6.4. Developer can use this version ( com.globalmentor - globalmentor-css version... - globalmentor-css in your Maven/Gradle project. Step 1: Create or use a Maven... - globalmentor-css version 0.6.4 Now the next step is to use the latest
CSS
hovers the mouse over the button. Use an external style sheet. Make sure your style sheet validates at Note that some warnings may be unavoidable, but your CSS
how to use a image in background in your application form?
how to use a image in background in your application form?  how to use a image in background in your application form
how to load pdf on html
how to load pdf on html  how to load pdf on html
How could I use Socket in my application?
How could I use Socket in my application?  I created an application dealing with the management of a supermarket using Hibernate and Swing. I found out today that I have to use also Socket and I don't know exactly what I could do
Simple Java Desktop Upload application
Simple Java Desktop Upload application  I try do simple example for upload applicationtake file from c:\ put to d:\ :) PLEASE HELP
Maven dependency for com.eriwen - gradle-css-plugin version 0.3 is released. Learn to use gradle-css-plugin version 0.3 in Maven based Java projects
use this version ( com.eriwen - gradle-css-plugin version 0.3 ) in their Java... are ready to use the  com.eriwen - gradle-css-plugin version 0.3 in your...Maven dependency for  com.eriwen  - Version 0.3 of gradle-css-plugin
simple bank application - JSP-Servlet
simple bank application  hi i got ur codings...But if we register a new user it is not updating in the database...so plz snd me the database also.... Thank you

Ads