Wednesday, February 20, 2019
Html Studyguide
The general syntax of a CSS room recipe is selector switch office1 value1 property2 value2 property3 value3 Order in which tendency tackings be interpreted. The more specific port is utilise instead of the more general. 1. 2. 3. 4. 5. Browsers internal elbow room sheet User- fructifyd direction sheet references outer style sheet Authors embedded style sheet Authors inline style sheet User-Defined Styles Almost all browsers allow phthisisrs to transform the default model outtings of the internal style sheet.External Style SheetsTo link to an external style sheet use of goods and services the following text directly supra the closing head text tag Embedded Style Sheets Styles are inserted directly within the head element of an HTML document utilise the style element styles Or h1 modify red schoolbook-align center The entrap in which external and embedded style sheets are processed depends on the order in which they are listed within the HTML file.In the to a lower place workout the loads the external style sheet first and consequently the embedded SS. If the order were switched the imported SS gets processed after the embedded one. h1 Color red Text-align center Inline Styles Applied directly to specific elements using the style ascribe Importing Style Sheets To import a style sheet to a master style sheet use the import rumor BEFORE any other style rules import url(url) or for example import url(sa_styles. css)Exploring the Style Cascade As a general rule of thumb, all other things being equal, the more specific style is applied instead of the more general . An additional factor in applying a style sheet is that properties are passed from a parent element to its children in a process known as style inheritance. body pretension blue h1 text-align center If you need browsers to enforce a style, you can cater the important keyword to the style property, using the syntax property value mportant delimitate Color in CSS A falsify value is a numerical expression that describes the properties of a color CSS represents these intensities mathematically as a enclothe of numbers called an RGB triplet, which has the put color rgb(red, green, blue) colorredgreenblue background-color color color color or or or or color rgb(255,255,0) colorFFFF00 background-color rgb(255,255,0) or colorFFFF00 or colorwhite CSS as well allows RGB values to be entered as hexadecimal numbers To frozen the background color of an element, use the below property where color is a color name or a color value.To set the foreground or text color of an element, use the following property color rgb(255,255,0) or or CSS3 also supports the Hue Saturation Lightness (HSL) model that describes colors based on hue, saturation, and lightness hsl(hue, saturation, lightness) rgba(red, green, blue, opacity) hsl(360, 100%, 100%) rgba(255, 255, 255, 0. 8) hsla(360, 100%, 100%, 0. 2) CSS3 also allows rascal designers to augment RGB and HSL color wit h opacity where 0 = completely transparent and 1 = completely opaque. hsla(hue, saturation, lightness, opacity) orSelectors and Text Styles Web pages are structured documents in which elements are nested within other elements, forming a hierarchy of elements. To create styles that experience advantage of this tree structure, CSS allows you to create contextual selectors whose values represent the locations of elements within the hierarchy 1) 2) 3) 4) Parent elements Child elements Sibling elements Descendant elements Contextual Selectors place Selectors Selectors also can be defined based on attributes and attribute values associated with elements.Two attributes, id and class, are often key in targeting styles to a specific element or group of elements. Styling Web Page Text The default event used by most browsers is Times parvenu Roman, but you can mark a different font for any page element using the property font-family fonts or font-family Arial Black, gadget, sans-serif mi se en scene Font Face and Sizes Sizes can be relative or absolute. To define a font face, use the style property font-family fonts font- coat size letter-spacing size word-spacing size To specify the font style, use the below style where role is normal, italic, or oblique. ont-style type To specify the font weight, use the below format where type is normal, bold, bolder, light, lighter, or a font weight value. font-weight type To specify a text decoration, use the below format where type is none, underline, overline, or line-through. text-decoration type To transform text, use the below code where type is capitalize, uppercase, lowercase, or none. text-transform type To display a font variant of text, use the below format where type is normal or small-caps. ont-variant type You can intermingle most of the text and font styles into a single property using the shortcut font property font font-style font-variant font-weight font-size/line-height font-family Combining Text order in a single style or or or font-family Arial Black, gadget, sans-serif font-size 0. 5in or font-size 36pt font-size 0. 5in or font-size 3pc or font-size 1. 7em To set a font size, use the below style property where size is a CSS social unit of continuance in either relative or absolute units.To set kerning (the space between letters), use the following style property To set tracking (the space between words), use the following style property Designing a List To define the appearance of the list marker, use the style below where type is disc, circle, square, decimal, decimal-leading-zero, lower-roman, upper-roman, lower-alpha, upper-alpha, lower-greek, upper-greek, or none. list-style-type type To insert a graphic image as a list marker, use the style below where url is the URL of the graphic image file. ist-style-image url(url) To set the come out of list markers, use the style below where position is inside or outside. list-style-position position To define all of the list style pro perties in a single style, use the following style list-style type url(url) position To set the indentation of a list, apply the style below where size is the length that the list should be indented. padding-left size Using Pseudo-Classes and Pseudo-Elements A pseudo-class is a motley of an element based on its current status, position, or use in the document selectorpseudo-class styles Structural Psuedo Classes
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment