Category Archive for: CSS

CSS Cursor

cursor This property is used to specify the type of cursor displayed for the pointing device. Applicable Values: auto – The UA determines the cursor to display based on the current context. crosshair – A simple crosshair (e.g., short line segments resembling a “+” sign). default – The platform-dependent default cursor. Often rendered as an…

Read More →

CSS Float

Similar to Position property, float is also used to position elements. float Applicable Values: left The element generates a block box that is floated to the left. Content flows on the right side of the box, starting at the top (subject to the ‘clear’ property). right Similar to ‘left’, except the box is floated to the…

Read More →

CSS Position

This is a very important property used to change the position of all the elements. position Applicable Values: static This is the default position value that is applied to all the elements. Elements with “position : static” is displayed the same as normal flow.   relative Elements with “position :relative” will appear in normal flow.…

Read More →

CSS Outline

Outline is used to markup elements to make them stand out. Outline doesn’t affects the position of the element. outline-width This property is used to specify the width of the outline. Applicable values: thin, medium, thick Or else the values should be specified in pixels e.g., 2px outline-style This property specifies the line style of…

Read More →

CSS Display

display This property is used to change the way the content gets displayed. Applicable Values: none–hides the element and all its descendant.  block – applies line break before and after the element.creates The element occupies 100% width of the parent container (if width not specified) inline – removes the line break (if present) before and…

Read More →

CSS Font

font-family This property is used to specify the list of font family names separated by comma to indicate that they are alternatives. HTML snippet: <div> Hello world! This is a sample text </div> CSS snippet: div{ background-color : #e1e1e1; font-family : sans-serif; } Output: The text within <div> element will be displayed in sans-serif font.…

Read More →

CSS Text

text-align This property is used to align the text within its parent container. Applicable Values: left, right, center, justify, inherit inherit – it specifies that the value should be same as the value of its parent. HTML snippet: <div> Hello world! This is a sample text </div> CSS snippet: div{ background-color : #e1e1e1; text-align :…

Read More →

CSS Color

color Used to set the foreground color (font color).   Default color: black HTML snippet: <div> Hello world! This is a sample text </div> CSS snippet: div{ background-color : #e1e1e1; color : #dd4b39; } Output: The color of the font will be changed to red color.

CSS Margin

What is margin? Margin is the space around the element (on which the style is applied).   Difference between Margin and Padding Margin: it provides the space outside the border of the element Padding: it provides the space inside the border of the element   HTML snippet: <div id=”parent”> This is parent element <div id=”child”>…

Read More →

CSS Padding

In this padding tutorial, we will be using a <div> HTML tag to apply the styles.   What is padding? Padding is the space between the element (on which the style is applied) and its child elements. HTML snippet <body> <div> Hello world </div> </body>   Consider the above HTML snippet. Here the <div> tag…

Read More →

Back to Top