Posts

CSS borders

  CSS borders The CSS allows to style borders by using CSS border properties like color, style, width, etc of properties. CSS border style:   The border-style styles the border by using a different kind of borders . Following are the list of the borders kind,we can use in the css dotted =: give dotted border to the border dashed =: give dashed border to the border solid =: give Solid border to the border double =:give double border to the border groove =: give 3D groove border to the border. The effect depends on the border-color value ridge =: give 3D ridge border to the border. The effect depends on the border-color value inset =: give 3D inset border to the border. The effect depends on the border-color value outset =: give 3D outset border to the border. The effect depends on the border-color value none =:give no border to the border hidden =:give hidden border to the border Example of css border style: <style type="text/css"> p.dashed{ border-style:

CSS Pseudo classes

  Pseudo classes In this article ,we will learn about the common pseudo classes which are used in the CSS language during designing the web development. :first-child() :last-child() :nth-child() :nth-last-child :nth-last-type-child :nth-of-type :only-child :only-of-type :last-of-type :first-of-type :empty :not() First-child() In the following example,selectors match all the first child of div section div.box1 p:first child{ color:blue; } <div class=”box1”> <p>programgrab1</p> <p>programgrab2</p> <div class=”box2”> <p>programgrab1</p> <p>programgrab2</p> </div></div> last-child() In the following example,selectors match all the last child<p> of div section div.box1 p:last child{ color:blue; } <div class=”box1”> <p>programgrab1</p> <p>programgrab2</p> <div class=”box2”> <p>programgrab1</p> <p>programgrab2</p> </div></div> nth-child() In the

CSS combinators

  Likewise simple selectors in CSS, we can also combine more than one simple selector is called CSS combinators. There are four types of CSS combinators in the CSS. Descendant selector(space) Child selector(>) Adjacent sibling selectors(+) General sibling selectors(~) Descendant selectors(space) By name, the descendant selectors select all the descendant elements of the specific element. Actually, this is used in the nested elements. Example: div p{ Color: red; } Change the color of all <p> in the div section <div> <p>programgrab</p> <p>programgrab</p> </div> Child selectors(>) This selects all the child element of the specific element Example: div > p{ Color: red; } <div> <p>programgrab</p> <p>programgrab</p> <div class=”header”> <p>programgrab</p> </div> </div> Change the color of all children <p> in the div section and not the second div section. Adjacent sibling sele

CSS selector

Image
CSS selector: There are five types of selectors used in the CSS language.  Simple selectors Combinator selectors Pseudo-class selectors Pseudo-element selectors Attribute selectors Here, we will discuss the simple selectors of the CSS language. The CSS element selector: By name, this selector is select direct the elements of HTML Example: h1{ Color: red; Background-color:white; text-align:center; } The CSS id selector The id attribute is used in the HTML page for selecting the unique element. These id attributes are also used for styling in the CSS. How to style the id in CSS? For the select elements with a unique id use hashtag(#) followed by the name of the id. Example: #header{ Color: red; Background-color:white; text-align:center; } How to style class in id? The CSS class selector: The class selector selects the element of HTML which uses the class attribute. The dot(.) followed by the class name used for styling the class attribute. Following is an example of the class selector.

Types of CSS (cascading style sheet)

  The cascading style sheet is used to style the webpages of any website which contain different properties to style the webpage e.g control font style, font size, font color,  background color,and much more. There are three types of CSS Inline CSS Internal CSS External CSS Inline CSS The CSS write under the body section, in the HTML tags with style attributes is called inline CSS. Following is the example of inline CSS Example: <!DOCTYPE html> <html> <head> <title>Inline CSS</title> </head> <body> <p style ="color: red; font-size: 40px; font-family: initial; text-align: center;"> Programgrab </p> </body> </html> Internal CSS The CSS write in the head section of an HTML page with the style attribute is called internal CSS.Following is the example of internal CSS Example: <!DOCTYPE html> <html> <head> <title>Internal CSS</title> <style type="text/css">