Adjust the text in an element using the text-align property in CSS:
- Text is often a large part of web content.
- CSS has several options for how to align it with the "text-align" property.
- "text-align: justify;" spaces the text so that each line has the same width.
- "text-align: left;" aligns the text to left(default).
- "text-align: right;" aligns the text to right.
- "text-align: center;" aligns the text at the center.
element{
text-align: center;
}
Adjust the width of an element using the Width property:
- The width of an element can be specified using the "width" property in CSS.
- Values can be given in relative (em) or in absolute (px) units, or as a percentage of its containing parent element.
- For example:
element {
width: units;
}
Adjust the height of an element using the height property:
- The height property is the same as the width property.
element {
width: units;
}
No comments:
Post a Comment