0% found this document useful (0 votes)
19 views

Css PDF

Uploaded by

temp temp
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
19 views

Css PDF

Uploaded by

temp temp
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 26
= &@ OO wy The iframe element The iframe element 3 w Menuy Q 0 Login schools CSS JAVASCRIPT SQL PYTHON WITN tne world's largest weD developer site. Search our tutorials, e.g. HTML Q = Run Noframe tag Sorry! Your browser does not support frames. java point HTML Table HTML table tag is used to display data in tabular form (row * column). There can he manv java point CSS Table We can apply style on HTML tables for better look and feel. There are some CSS nranartias (SS RPV Nes da CSS stands for Cascading Style Sheets. CSS saves a lot of work. It can control the layout of multiple web pages all at once. What is CSS? Cascading Style Sheets (CSS) is used to format the layout of a webpage. With CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors are to be used, different displays for different devices and screen sizes, and much more! me CSs JAVASCRIPT SQL PYTHON Using CSS CSS can be added to HTML documents in 3 ways: « Inline - by using the style attribute inside HTML elements « Internal - by using a This is a heading

This is a paragraph.

¢=5e 0 iy This is a heading

This is a paragraph.

This is a heading This is a paragraph. External CSS An external style sheet is used to define the style for many HTML pages. To use an external style sheet, add a link to it in the section of each HTML page: Example This is a heading

This is a paragraph.

Try it Yourself » ¢=>e 0 iy This is a heading

This is a paragraph.

This is a heading This is a paragraph. mh ass) JAVASCRIPT sto} i The external style sheet can be written in any text editor. The file must not contain any HTML code, and must be saved with a .css extension. Here is what the "styles.css" file looks like: "styles.css": body { background-color: powderblue; 3 hi { color: blue; } Bot color: red; 3 Tip: With an external style sheet, you can change the look of an entire web site, by changing one file! ee > | This is a heading tn26 28 @ BaPAstAoL, or > | This is a heading

This is a paragraph.

This is a paragraph.

This is a paragraph.

This is a heading This is a paragraph. This is a paragraph. This is a paragraph. ¢=5.e 0 im This is a heading

This is a paragraph.

This is a paragraph.

This is a paragraph.

This is a heading This is a paragraph. This is a paragraph. This is a paragraph. CSS Border The CSS border property defines a border around an HTML element. Tip: You can define a border for nearly all HTML elements. Example Use of CSS border property: pf border: 2px solid powderblue; Try it Yourself » CSS Padding The CSS padding property defines a padding (space) between the text and the border. The CSS id Selector The id selector uses the id attribute of an HTML element to select a specific element. The id of an element is unique within a page, so the id selector is used to select one unique element! To select an element with a specific id, write a hash (#) character, followed by the id of the element. Example The CSS rule below will be applied to the HTML element with id="para1": #paral { text-align: center; color: red; Bama ees ¢5e 0 i

Hello World!

This paragraph is not affected by the style.

Hello World! This paragraph is not affected by the style. The CSS class Selector The class selector selects HTML elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the class name. Example In this example all HTML elements with class="center" will be red and center-aligned: -center { text-align: center; color: red; Try it Yourself » You can also specify that only specific HTML elements should be affected by a class. ¢=>e 0 iy Red and center-aligned heading

Red and center-aligned paragraph.

Red and center-aligned heading Red and center-aligned paragraph. «Se 0 iy Hello World

This is Web designing class. Now we are learning HTML and CSS

=e 0 iy

Hello World

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Hello World Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nis] ut aliquip ex ea commodo consequat. ¢=5 2 0 Ey Hello World Hello World Hello World Hello World Hello World Hello World «=e 0 iy

CSS Margins

This element has a margin of 70px.
CSS Margins his element has a margin of (70px. or > |

Using individual margin properties

This div element has a top margin of 100px, a right margin of 150px, a bottom margin of 100px, and a left margin of 80px.
Using individual margin properties his div element has la top margin of (LOOpx, a right margin| lof 150px, a bottom argin of 100px, and la left margin of 80px. mv GSS BEE Ne dae SQL PYTHON Margin - Shorthand Property To shorten the code, it is possible to specify all the margin properties in one property. The margin property is a shorthand property for the following individual margin properties: ¢ margin-top ¢ margin-right « margin-bottom ¢ margin-left So, here is how it works: If the margin property has four values: ¢ margin: 25px 50px 75px 100px; © top margin is 25px o right margin is 50px © bottom margin is 75px o left margin is 100px Example Use the margin shorthand property with four values: ¢5e 0 Ey

The margin] shorthand property - 4 values

This div element has a top margin of 25px, a right margin of 50px, a bottom margin of 75px, and a left margin of 100px.

The margin shorthand property - 4 values is div element has a top argin of 25px, a right margin lof SOpx, a bottom margin of |75px, and a left margin of (LOOpx.

Use of margin: auto

You can set the margin property to auto to horizontally center the element within its container.

This div will be horizontally centered because it has margin: auto;
Use of margin: auto You can set the margin property to auto to horizontally center the element within its container. his div be horizontally centered ecause it has margin: auto;

You might also like