CSS Properties 01
CSS Properties 01
<!DOCTYPE html>
<html>
<head>
<meta name = "authors" content = "Balbharti">
<meta name = "description" content ="Advance web designing">
<meta name = "keywords" content ="html5, learn html5, list in html5">
<meta name="copyright" content= " copyright Balbharti All right Reserve">
<style>
div {
background-color: green;
}
div.first {
opacity: 0.1;
}
div.second {
opacity: 0.3;
}
div.third {
opacity: 0.6;
}
</style>
</head>
<body>
<h1>Transparent Boxes</h1>
<p>When using the opacity property to add transparency to the background of an element,
all of its child elements become transparent as well. This can make the text inside a fully
transparent element hard to read:</p>
<div class="first">
<h1>opacity 0.1</h1>
</div>
<div class="second">
<h1>opacity 0.3</h1>
</div>
<div class="third">
<h1>opacity 0.6</h1>
</div>
<div>
<h1>opacity 1 (default)</h1>
</div>
</body>
</html>
3.4 background position and attachment
<!DOCTYPE html>
<html>
<head>
<meta name = "authors" content = "Balbharti">
<meta name = "description" content ="Advance web designing">
<meta name = "keywords" content ="html5, learn html5, list in html5">
<meta name="copyright" content= " copyright Balbharti All right Reserve">
<style>
body {
background-image: url("Capture.png");
background-repeat: no-repeat;
// background-position: right;
// background-position: left;
// background-position: center;
// background-position: right top;
// background-position: left top;
// background-position: center bottom;
// background-position: right bottom;
background-position: center bottom;
/*left top center */
}
</style>
</head>
<body>
<p><strong>Tip:</strong> If you do not see any scrollbars, try to resize the browser
window.</p>
scroll: It is the default value that prevents the element from scrolling with the contents, but scrolls with
the page.
fixed: Using this value, the background image doesn't move with the element, even the element has a
scrolling mechanism. It causes the image to be locked in one place, even the rest of the document
scrolls.
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url("Capture.png");
background-repeat: no-repeat;
// background-attachment: scroll;
background-attachment: fixed;
}
</style>
</head>
<body>
</body>
</html>
CSS Position
The CSS position property is used to set position for an element. it is also used to place an element
behind another and also useful for scripted animation effect.
You can position an element using the top, bottom, left and right properties. These properties can be
used only after position property is set first. A position element's computed position property is relative,
absolute, fixed or sticky.
This is a by default position for HTML elements. It always positions an element according to the normal
flow of the page. It is not affected by the top, bottom, left and right properties.
The fixed positioning property helps to put the text fixed on the browser. This fixed test is positioned
relative to the browser window, and doesn't move even you scroll the window.
The relative positioning property is used to set the element relative to its normal position.
The absolute positioning is used to position an element relative to the first parent element that has a
position other than static. If no such element is found, the containing block is HTML.