Showing posts with label Css computer language. Show all posts
Showing posts with label Css computer language. Show all posts

Thursday 5 December 2013

STYLE HTML ELEMENTS WITH SPECIFIC ATTRIBUTES


Style HTML Elements With Specific Attributes


It is possible to style HTML elements that have specific attributes, not just class and id.
Note: IE7 and IE8 support attribute selectors only if a !DOCTYPE is specified. Attribute selection is NOT supported in IE6 and lower.

Attribute Selector

The example below styles all elements with a title attribute:


Example

[title]
{
color:blue;
}


Attribute and Value Selector


The example below styles all elements with title="W3Schools":


Example

[title=W3Schools]
{
border:5px solid green;
}



Attribute and Value Selector - Multiple Values


The example below styles all elements with a title attribute that contains a specified value. This works even if the attribute has space separated values:


Example

[title~=hello] { color:blue; }

The example below styles all elements with a lang attribute that contains a specified value. This works even if the attribute has hyphen ( - ) separated values:

Example

CSS::STYLING FORMS


Styling Forms

The attribute selectors are particularly useful for styling forms without class or ID:


Example

input[type="text"]
{
width:150px;
display:block;
margin-bottom:10px;
background-color:yellow;
}
input[type="button"]
{
width:120px;
margin-left:35px;
display:block;
}

CSS : FLOAT


CSS Float?




With CSS float, an element can be pushed to the left or right, allowing other elements to wrap around it.
Float is very often used for images, but it is also useful when working with layouts.


How Elements Float
Elements are floated horizontally, this means that an element can only be floated left or right, not up or down.
A floated element will move as far to the left or right as it can. Usually this means all the way to the left or right of the containing element.
The elements after the floating element will flow around it.
The elements before the floating element will not be affected.
If an image is floated to the right, a following text flows around it, to the left:

Example

img
{
float:right;
}


Floating Elements Next to Each Other

If you place several floating elements after each other, they will float next to each other if there is room.

Here we have made an image gallery using the float property:

Example

.thumbnail 
{
float:left;
width:110px;
height:90px;
margin:5px;
}


Turning off Float - Using Clear
Elements after the floating element will flow around it. To avoid this, use the clear property.
The clear property specifies which sides of an element other floating elements are not allowed.
Add a text line into the image gallery, using the clear property:

Example

.text_line
{
clear:both;
}



All CSS Float Properties

The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2).
Property
Description
Values
CSS
clear
Specifies which sides of an element where other floating elements are not allowed
left
right
both
none
inherit
1
float
Specifies whether or not a box should float
left
right
none
inherit
1

Wednesday 4 December 2013

CSS : OVERLAPPING ELEMENTS

Overlapping Elements


When elements are positioned outside the normal flow, they can overlap other elements.
The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).
An element can have a positive or negative stack order:


Example

img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}

An element with greater stack order is always in front of an element with a lower stack order.
HINT: If two positioned elements overlap, without a z-index specified, the element positioned last in the HTML code will be shown on top.




Other Topics
CSS : Cross browser compatibality,CSS : Left and right Aligning by float property,CSS : Left &Amp; Right Aligning By Position Property,CSS : Center Aligning By Margin PropertyCSS : Aligning Block Elements,CSS : Float,CSS : All Css Positioning Properties,CSS : Overlapping Elements,CSS : Absolute Positioning,CSS : Fixed Positioning,CSS : Changing How An Element Is Viewed Or Displayed,CSS :Pseudo Classes,CSS :Before pseudo element,CSS :After pseudo element,CSS : Multiple pseudo elements,CSS : pseudo-elements and CSS classes,CSS : First-letter pseudo-element,CSS :  First-element pseudo-element,CSS : Syntax for Pseudo elements,CSS : First-line pseudo-element,CSS : All Css pseudo classes/elements,CSS : The lang pseudo classCSS : MEDIA,CSS::STYLING FORMS, mechanical Engineering, English books,Photoshop tutorials,Harry potter,Best 100 english books,Mechanical-old-question-paper,







CSS : CHANGING HOW AN ELEMENT IS VIEWED OR DISPLAYED

Changing How an Element is Displayed


Changing an inline element to a block element, or vice versa, can be useful for making the page look a specific way, and still follow web standards.
The following example displays list items as inline elements:


Example

li {display:inline;}

The following example displays span elements as block elements:


Example

span {display:block;}
Note: Changing the display type of an element changes only how the element is displayed, NOT what kind of element it is. For example: An inline element set to display:block is not allowed to have a block element nested inside of it.






Other Topics
CSS : Cross browser compatibality,CSS : Left and right Aligning by float property,CSS : Left &Amp; Right Aligning By Position Property,CSS : Center Aligning By Margin PropertyCSS : Aligning Block Elements,CSS : Float,CSS : All Css Positioning Properties,CSS : Overlapping Elements,CSS : Absolute Positioning,CSS : Fixed Positioning,CSS : Changing How An Element Is Viewed Or Displayed,CSS :Pseudo Classes,CSS :Before pseudo element,CSS :After pseudo element,CSS : Multiple pseudo elements,CSS : pseudo-elements and CSS classes,CSS : First-letter pseudo-element,CSS :  First-element pseudo-element,CSS : Syntax for Pseudo elements,CSS : First-line pseudo-element,CSS : All Css pseudo classes/elements,CSS : The lang pseudo classCSS : MEDIA,CSS::STYLING FORMS, mechanical Engineering, English books,Photoshop tutorials,Harry potter,Best 100 english books,Mechanical-old-question-paper,





CSS : FIXED POSITIONING

Fixed Positioning

An element with fixed position is positioned relative to the browser window.
It will not move even if the window is scrolled:

Example

p.pos_fixed
{
position:fixed;
top:30px;
right:5px;
}

HINT: IE7 and IE8 support the fixed value only if a !DOCTYPE is specified.
Fixed positioned elements are removed from the normal flow. The document and other elements behave like the fixed positioned element does not exist.
Fixed positioned elements can overlap other elements.






Other Topics
CSS : Cross browser compatibality,CSS : Left and right Aligning by float property,CSS : Left &Amp; Right Aligning By Position Property,CSS : Center Aligning By Margin PropertyCSS : Aligning Block Elements,CSS : Float,CSS : All Css Positioning Properties,CSS : Overlapping Elements,CSS : Absolute Positioning,CSS : Fixed Positioning,CSS : Changing How An Element Is Viewed Or Displayed,CSS :Pseudo Classes,CSS :Before pseudo element,CSS :After pseudo element,CSS : Multiple pseudo elements,CSS : pseudo-elements and CSS classes,CSS : First-letter pseudo-element,CSS :  First-element pseudo-element,CSS : Syntax for Pseudo elements,CSS : First-line pseudo-element,CSS : All Css pseudo classes/elements,CSS : The lang pseudo classCSS : MEDIA,CSS::STYLING FORMS, mechanical Engineering, English books,Photoshop tutorials,Harry potter,Best 100 english books,Mechanical-old-question-paper,







CSS : ABSOLUTE POSITIONING

Absolute Positioning


An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>:


Example

h2
{
position:absolute;
left:100px;
top:150px;
}

Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist. Absolutely positioned elements can overlap other elements.





Other Topics
CSS : Cross browser compatibality,CSS : Left and right Aligning by float property,CSS : Left &Amp; Right Aligning By Position Property,CSS : Center Aligning By Margin PropertyCSS : Aligning Block Elements,CSS : Float,CSS : All Css Positioning Properties,CSS : Overlapping Elements,CSS : Absolute Positioning,CSS : Fixed Positioning,CSS : Changing How An Element Is Viewed Or Displayed,CSS :Pseudo Classes,CSS :Before pseudo element,CSS :After pseudo element,CSS : Multiple pseudo elements,CSS : pseudo-elements and CSS classes,CSS : First-letter pseudo-element,CSS :  First-element pseudo-element,CSS : Syntax for Pseudo elements,CSS : First-line pseudo-element,CSS : All Css pseudo classes/elements,CSS : The lang pseudo classCSS : MEDIA,CSS::STYLING FORMS, mechanical Engineering, English books,Photoshop tutorials,Harry potter,Best 100 english books,Mechanical-old-question-paper,

CSS : ALL CSS POSITIONING PROPERTIES


All CSS Positioning Properties


The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2).


Property
Description
Values
CSS
bottom
Sets the bottom margin edge for a positioned box
auto
length
%
inherit
2
clip
Clips an absolutely positioned element
shape
auto
inherit
2
cursor
Specifies the type of cursor to be displayed
url
auto
crosshair
default
pointer
move
e-resize
ne-resize
nw-resize
n-resize
se-resize
sw-resize
s-resize
w-resize
text
wait
help
2
left
Sets the left margin edge for a positioned box
auto
length
%
inherit
2
overflow
Specifies what happens if content overflows an element's box
auto
hidden
scroll
visible
inherit
2
position
Specifies the type of positioning for an element
absolute
fixed
relative
static
inherit
2
right
Sets the right margin edge for a positioned box
auto
length
%
inherit
2
top
Sets the top margin edge for a positioned box
auto
length
%
inherit
2
z-index
Sets the stack order of an element
number
auto
inherit
2

Physics basic inventions and inventors

1.Which instrument is used to measure altitudes in aircraft's ? Audiometer Ammeter Altimeter Anemometer Explanation : ...