3 - Chapter 3 Part I - CSS
3 - Chapter 3 Part I - CSS
<style>
p{
color: blue;
/* This is a single-line comment */
text-align: center;
}
/* This is
a multi-line
comment */
</style>
• Example
background-color: #988989; background-color: #988989;
• Background-image: used to set an image as a background of an element
#t1{ #t2{
border-collapse: separate; border-collapse: separate;
border-spacing: 45px; border-spacing: 20pt 1em;
} }
border-image: linear-gradient(orange,
yellow, green) 40 / 30px 10px stretch;
border-image: radial-gradient(farthest-side,
red, yellow, green) 30 / 15px round;
• Syntax
• float: none | right | left | initial | inherit;
margin This property is used to set all the properties in one declaration.
margin-left it is used to set left margin of an element.
margin-right It is used to set right margin of an element.
margin-top It is used to set top margin of an element.
margin-bottom It is used to set bottom margin of an element.
cursor It is used to specify the type of cursors to be url, auto, crosshair, default, pointer,
displayed. move, e-resize, ne-resize, nw-resize, n-
resize, se-resize, sw-resize, s-resize, w-
resize, text, wait, help
left It sets a left margin edge for a positioned box. auto, length, %, inherit
overflow This property is used to define what happens if auto, hidden, scroll, visible, inherit
content overflow an element's box.
position It is used to specify the type of positioning for an absolute, fixed, relative, static, inherit
element.
right It is used to set a right margin edge for a positioned auto, length, %, inherit
box.
top It is used to set a top margin edge for a positioned auto, length, %, inherit
box.
z-index It is used to set stack order of an element. number, auto, inherit
normal This property is used to break words only at allowed break points.
<style>
p.test { break-word It is used to break unbreakable words.
width: 11em; initial It is used to set this property to its default value.
background-color: #00ffff;
inherit
border: 1px solid #000000; It inherits this property from its parent element.
padding:10px;
word-wrap: break-word; Output
}
</style>
</head>
<body>
<p class="test"> In this paragraph, there is a very long word:
iamsooooooooooooooooooooooooooooooolongggggggggggggggg.The long word will break and wrap t
o the next line.</p>
</body>