- How do you place two paragraphs next to each other?
- Float one or both inner divs with float left and width
- What is CSS declaration?
- A declaration is made up of a property name and a value, separated by a colon
- What are CSS pseudo-classes?
- CSS pseudo-classes are used to add special effects to some selectors.
- Selector:pseudo-class {property:value;}
- selector.class:pseudo-class {property:value;}
- Example :
a.red:visited {color:#FF0000;}
- CSS pseudo-classes are used to add special effects to some selectors.
- Can Style Sheets and HTML stylistic elements be used in the same document?
- yes
- I made a 10px-height div, but IE makes it 20px height how to solve this ?
- when you make a div just to contain the bottom border of a box solution is make font size is zero
- What is grouping in CSS?
- If you want to apply same styles to few properties then grouping is best to use the syntax is below
.copyright, .tagline, .hint {font-style: italic}
- If you want to apply same styles to few properties then grouping is best to use the syntax is below
- What is parent-child selector?
- Parent-child selector is a selector representing the direct descendent of a parent element. Parent-child selectors are created by listing two or more tilde (~) separated selectors.
BODY ~ P {background: red; color: white}
The P element will be declared the specified style only if it directly descends from the BODY element:<BODY> <P>Red and white paragraph </P> </BODY>
- Parent-child selector is a selector representing the direct descendent of a parent element. Parent-child selectors are created by listing two or more tilde (~) separated selectors.
- What is cascade?
- Cascade is a method of defining the weight (importance) of individual styling rules thus allowing conflicting rules to be sorted out should such rules apply to the same selector.
- Is Style Sheets case sensitive?
- No
- How to include comments in Style Sheet?
- Syntax:
/* This is a CSS-comment */
- Syntax:
- How do you target a certain browser?
- IE can be targetted by preceding your properties with ‘* html’. For example…
#nav {position:relative;}
* html #nav { /* this will target IE */
position:absolute; } - and the second way is
<!--[if IE]> <link href="ieonly.css" rel="stylesheet" type="text/css"> <![endif]—>
- IE can be targetted by preceding your properties with ‘* html’. For example…
- What is !important ?
- It will override declarations with normal weight .
- Can CSS be used with other than HTML documents?
- Yes. CSS can be used with any structured document format.
- Which characters can CSS names contain ?
- A to Z, a to z, 0 to 9 and Unicode characters 161 to 255
- How do you make a tool tip that appears on hover?
<a title="This is some information for our tooltip." class="tooltip">CSS3 Tooltip</a>
.tooltip
{
display: inline;
position: relative;
}
.tooltip:hover:after{background: #333;
background: rgba(0,0,0,.8);
border-radius: 5px;
bottom: 26px;
color: #fff;
content: attr(title);
left: 20%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 220px;
}