Docsity

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

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 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;}

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'.