Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSS and HTML: Understanding Divs, Spans, and Stylesheets, Study notes of Computer Numerical Control

An overview of css and html, focusing on the use of divs, spans, and stylesheets. It covers the relationship between html tags and css classes, the difference between divs and spans, and various css properties such as font-size, line-height, text-decoration, and positioning.

Typology: Study notes

2010/2011

Uploaded on 09/06/2011

nirmalya
nirmalya 🇮🇳

4.5

(2)

17 documents

1 / 35

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Style Sheet NOTE
* THIS SLIDE SHOW IS NOT
SUFFICIENT FOR TEST OR EXAM
PREPRATION.
* STYLE SHEET/CSS SLIDES ARE
INCOMPLETE AND DOES NOT
INCLUDE ALL THE DETAILS
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23

Partial preview of the text

Download CSS and HTML: Understanding Divs, Spans, and Stylesheets and more Study notes Computer Numerical Control in PDF only on Docsity!

Style Sheet NOTE

* THIS SLIDE SHOW IS NOT

SUFFICIENT FOR TEST OR EXAM

PREPRATION.

* STYLE SHEET/CSS SLIDES ARE

INCOMPLETE AND DOES NOT

INCLUDE ALL THE DETAILS

Linking External CSS file:-

<link rel="stylesheet"

type="text/css"

href="styles.css" >

LINK tag’s REL attribute specifies the relationship

between the current document and the linked

document

Style Sheet classes Using class name as a selector is a good approach If you expect to have formatting variations for different instances of a single element OR If You would like to have different elements share the same format.

This is a normal paragraph.

This is a paragraph that uses the p.first CSS code!

This is a paragraph that uses the p.second CSS code!

  • Like class, ID is an HTML attribute that does not affect the display of an element and can be applied to any element.
  • Many elements can have the same CLASS attribute value.
  • Only one element in any document have a particular ID attribute value. Style Sheet ID

and / These are generic tags they do not apply inherent formatting to its contents. main use is to apply styles or ID attributes to a block of text. [text level tags , etc]

does not have inherent styles, but it is displayed in its own line with margins above and below (and called block level element). It defines logical divisions. It’s a block level tag. Eg:-

 

This is a DIV sample.
**OUTPUT**

This is a DIV sample.

Span

  • (^) is similar to div in that they both divide the content into individual sections.
  • (^) The difference is that span goes into a finer level, so we can span to format a single character if needed.
  • (^) There is no line feed after the tag.

OUTPUT

Span is not at the block level.

STYLE PROPERTIES

The font-size property specifies the size of the font. The size can be specified in one of the 4 ways:- absolute, relative, length or percentage. Syntax: {font-size : absolute / relative / length / percentage;} <any_valid_tag style=“font-size : large”> The size can be numerical (length (pt / px) or percentage), or in text (possible values are "xx-large", "x-large", "large", "medium", "small", "x-small", and "xx-small").

CSS line-height Property The line-height property specifies the line height. Used to set the vertical distance between the baseline of adjacent lines of text. Value Description normal A normal line height. This is default number A number that will be multiplied with the current font size to set the line height length A fixed line height in px, pt, cm, etc. % A line height in percent of the current font size

text-decoration The text-decoration property specifies how text is decorated. Possible values are:

  • (^) underline : adds an underline to the text
  • (^) overline : adds a line on top of the text
  • (^) line-through : adds a line through the middle of the text.
  • (^) blink : causes the text to blink.
  • (^) The border-style property defines the format of the border.

One of the commonly-seen layout, especially in large websites displaying ads, is wrapping the text around an advertising block. This is accomplished using the float property. The float property has three possible values: 'left', 'right', and 'none'.