G. Pullaiah College of Engineering and Technology
G. Pullaiah College of Engineering and Technology
Paragaph Tag :
The <p> tag offers a way to structure your text into
different paragraphs. Each paragraph of text should go
in between an opening <p> and a closing </p> tag
.
Line Break Tag :
Whenever you use the <br /> element, anything
following it starts from the next line. This tag is an
example of an empty element, where you do not need
opening and closing tags, as there is nothing to go in
between them.
The <br /> tag has a space between the
characters br and the forward slash. If you omit this
space, older browsers will have trouble rendering the line
break, while if you miss the forward slash character and
just use <br> it is not valid in XHTML
.
Centering content :
You can use <center> tag to put any content in the center of
the page or any table cell.
Example
<p>This text is not in the center.</p>
<center>
<p>This text is in the center.</p>
</center>
.
Horizontal Line :
Horizontal lines are used to visually break up sections of
a document. The <hr> tag creates a line from the current
position in the document to the right margin and breaks
the line accordingly.
Preserve Formatting :
Sometimes you want your text to follow the exact format
of how it is written in the HTML document. In those
cases, you can use the preformatted tag <pre>.
Example
<!DOCTYPE html>
<html>
<head>
<title>Preserve Formatting Example</title>
</head>
<body>
<pre>
function testFunction( strText )
{ alert (strText)
} </pre>
</body> </html>
Nonbresking Spaces :
Suppose you want to use the phrase "12 Angry
Men." Here you would not want a browser to split
the "12, Angry" and "Men" across two lines:
An example of this technique appears in the movie "12
Angry Men."In cases where you do not want the client
browser to break text, you should use a nonbreaking
space entity instead of a normal space. For
example, when coding the "12 Angry Men" in a
paragraph, you should use something similar to the
following code:
Example
<!DOCTYPE html>
<html>
<head>
<title>Nonbreaking Spaces Example</title>
</head>
<body>
<p>An example of this technique appears in the movie
"12 Angry Men."</p>
</body> </html>
Meta Tag :
Metadata is data (information) about data.
The <meta> tag provides metadata about the HTML
document. Metadata will not be displayed on the page,
but will be machine parsable.
Meta elements are typically used to specify page
description, keywords, author of the document, last
modified, and other metadata.
The metadata can be used by browsers (how to display
content or reload page), search engines (keywords), or
other web services.
Browser Support
Element Chrome Mozilla Uc Opera others
<meta> Yes Yes Yes Yes Yes
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body></html>
External CSS:
An external style sheet is used to define the style for many
HTML pages.
With an external style sheet, you can change the look of
an entire web site, by changing one file!
To use an external style sheet, add a link to it in the <head>
section of the HTML page:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
CSS Fonts :
The CSS color property defines the text color to be used.
The CSS font-family property defines the font to be used.
The CSS font-size property defines the text size to be used.
EXAMPLE :
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: blue;
font-family: verdana;
font-size: 300%;
}
p {
color: red;
font-family: courier;
font-size: 160%;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Property IE Firefox Chrome Safari Opera
align-content 11 28 21 9 12.1
align-items 11 20 21 9 12.1
align-self 11 20 21 9 12.1
all 27 37 24
@keyframes 10 16 43 9 30
animation 10 16 43 9 30
animation-name 10 16 43 9 30
animation-duration 10 16 43 9 30
animation-timing-function 10 16 43 9 30
animation-delay 10 16 43 9 30
animation-iteration-count 10 16 43 9 30
animation-direction 10 16 43 9 30
animation-play-state 10 16 43 9 30
backface-visibility 10 16 36 9 23
background-clip 9 4 4 3 10.5
background-origin 9 4 4 3 10.5
background-size 9 4 4 4.1 10
border-bottom-left-radius 9 4 5 5 10.5
border-bottom-right-radius 9 4 5 5 10.5
border-image 11 15 16 6 15
border-image-outset 11 15 15 6 15
border-image-repeat 11 15 15 6 15
border-image-slice 11 15 15 6 15
border-image-source 11 15 15 6 15
border-image-width 11 13 15 6 15
border-radius 9 4 5 5 10.5
border-top-left-radius 9 4 5 5 10.5
border-top-right-radius 9 4 5 5 10.5
box-decoration-break 32 22 6.1
HTML Layout Elements :
Websites often display content in multiple columns (like
a magazine or newspaper).
HTML5 offers new semantic elements that define the
different parts of a web page:
<header> - Defines a header for a document or a section
<nav> - Defines a container for navigation links
<section> - Defines a section in a document
<article> - Defines an independent self-contained article
<aside> - Defines content aside from the content (like a
sidebar)
<footer> - Defines a footer for a document or a section
<details> - Defines additional details
<summary> - Defines a heading for the <details>
element
CSS SELECTORS
Selector Example Example description CSS
.class .intro Selects all elements with class="intro" 1
#id #firstname Selects the element with id="firstname" 1
* * Selects all elements 2
element p Selects all <p> elements 1
element,element div, p Selects all <div> elements and all <p> elements 1
element element div p Selects all <p> elements inside <div> elements 1
element>element div > p Selects all <p> elements where the parent is a <div> element 2
element+element div + p Selects all <p> elements that are placed immediately after <div> elements 2
element1~element2 p ~ ul Selects every <ul> element that are preceded by a <p> element 3
[attribute~=value] [title~=flower] Selects all elements with a title attribute containing the word "flower" 2
[attribute|=value] [lang|=en] Selects all elements with a lang attribute value starting with "en" 2
[attribute^=value] a[href^="https"] Selects every <a> element whose href attribute value begins with "https" 3
Department of Computer Science & Engineering