Justifying Text Alignment Sometimes in word processing, we want all lines of a paragraph to appear as if they have the same length. That is, we may want each line of text to cover the whole horizontal part available. To let you take care of this, CSS provides an option in the text-align style with a value as justify. Here is an example of applying it: <html>
<head>
<title>Social Science Studies</title>
<style>
.main-title {
text-align: center;
font-weight: bold;
color: Red;
font-size: 0.86cm;
font-family: Bodoni MT Black, Georgia, Times New Roman, serif;
}
.sub-title {
text-align: left;
color: Blue;
font-size: 0.64cm;
font-family: Georgia, Times New Roman, serif;
}
.introduction {
text-align: justify;
color: Black;
font-family: Georgia, Garamond, Times New Roman, serif;
}
.contribution {
text-align: left;
color: Black;
font-family: Georgia, Garamond, Times New Roman, serif;
}
.paragraph {
text-align: justify;
color: Black;
font-family: Georgia, Garamond, Times New Roman, serif;
}
</style>
</head>
<body>
<p class="main-title">Social Science Studies</p>
<p class="sub-title">Introduction</p>
<p class="introduction">Social sciences cover a wide range of studies that address all
types of topics about human beings, their behaviors, their history, their societies,
and their environments. Regular social science areas include sociology, psychology,
philosoply, linguistics, communication, history, geography, demography, ethnicity,
anthropology, archaeology, political science, law, education, criminology, and
economy, just to name a few. Some social science topics are grouped in categories,
such as individual or crowd, where studies tend to address the same categorical
isssues. Still, social sciences are highly interchangeable. Sometimes, differences
are a matter of interpretations based on the particular area(s) being considered.</p>
<p class="sub-title">Social Science Contributions</p>
<p class="contribution">Social sciences are not strictly confined to the above list.
Studies in chemistry borrow concepts from sociology, anthropology, and economy.
Mathematics and medicine, that are sometimes said not to be a science,
regularly share theories with philosophy, psychology, or criminology. In the same
way, it is practically impossible to study computer science, which includes computer
languages and application programming, without referring to linguistics. As a
conclusion, social sciences are not restricted to one area of study but
contribute to various types of sciences, studies, and disciplines.</p>
<p class="sub-title">Recommendations</p>
<p class="paragraph">If you are planning to study any of the scocial science topics,
find a good school.</p>
<p>Schools | Majors | Minors</p>
<p>Copyright © 2015</p>
</body>
</html>
This would produce: Controlling Text Alignment To let you control text justification with more options, CSS supports an additional style named text-justify. This style is used as a complement to text-align. This means that the text-justify style by itself does nothing. It must be accompanied by a text-align whose value is set to justify. The values of the text-justify style are auto, newspaper, distribute, distribute-all-lines, inter- cluster, inter-ideograph, inter-word, and kashida. Here is an example: <html> <head> <title>Social Science Studies</title> <style> .main-title { text-align: center; font-weight: bold; color: Red; font-size: 0.86cm; font-family: Bodoni MT Black, Georgia, Times New Roman, serif; } .sub-title { text-align: left; color: Blue; font-size: 0.64cm; font-family: Georgia, Times New Roman, serif; } .introduction { text-align: justify; text-justify: newspaper; color: Black; font-family: Georgia, Garamond, Times New Roman, serif; } .contribution { text-align: left; text-justify: newspaper; color: Black; font-family: Georgia, Garamond, Times New Roman, serif; } .paragraph { text-align: left; color: Black; font-family: Georgia, Garamond, Times New Roman, serif; } </style> </head> <body> <p class="main-title">Social Science Studies</p> <p class="sub-title">Introduction</p> <p class="introduction">Social sciences cover a wide range of studies that address all types of topics about human beings, their behaviors, their history, their societies, and their environments. Regular social science areas include sociology, psychology, philosoply, linguistics, communication, history, geography, demography, ethnicity, anthropology, archaeology, political science, law, education, criminology, and economy, just to name a few. Some social science topics are grouped in categories, such as individual or crowd, where studies tend to address the same categorical isssues. Still, social sciences are highly interchangeable. Sometimes, differences are a matter of interpretations based on the particular area(s) being considered.</p> <p class="sub-title">Social Science Contributions</p> <p class="contribution">Social sciences are not strictly confined to the above list. Studies in chemistry borrow concepts from sociology, anthropology, and economy. Mathematics and medicine, that are sometimes said not to be a science, regularly share theories with philosophy, psychology, or criminology. In the same way, it is practically impossible to study computer science, which includes computer languages and application programming, without referring to linguistics. As a conclusion, social sciences are not restricted to one area of study but contribute to various types of sciences, studies, and disciplines.</p> <p class="sub-title">Recommendations</p> <p class="paragraph">If you are planning to study any of the scocial science topics, find a good school.</p> <p>Schools | Majors | Minors</p> <p>Copyright © 2015</p> </body> </html> This would produce: Wrapping Text Wrapping text consists of deciding whether to break or not break words that would exceed the boundaries of the area where their line displays. To support this operation, CSS provides the word-wrap style. The two possible values of this style are normal and break-word. Indenting a Paragraph A regular characteristic of text formatting in word processing is to indent the first line of a paragraph. To support this operation, CSS has a style named text-indent. The indentation is specified by an HTML-based constant number or a relative value expressed as a percentage. Here is an example: <html> <head> <title>Social Science Studies</title> <style> .main-title { text-align: center; font-weight: bold; color: Red; font-size: 0.86cm; font-family: Bodoni MT Black, Georgia, Times New Roman, serif; } .sub-title { text-align: left; color: Blue; font-size: 0.64cm; font-family: Georgia, Times New Roman, serif; } .introduction { text-indent: 24pt; text-align: justify; color: Black; font-family: Georgia, Garamond, Times New Roman, serif; } .contribution { text-indent: 24pt; text-align: left; color: Black; font-family: Georgia, Garamond, Times New Roman, serif; } .paragraph { text-align: left; color: Black; font-family: Georgia, Garamond, Times New Roman, serif; } </style> </head> <body> <p class="main-title">Social Science Studies</p> <p class="sub-title">Introduction</p> <p class="introduction">Social sciences cover a wide range of studies that address all types of topics about human beings, their behaviors, their history, their societies, and their environments. Regular social science areas include sociology, psychology, philosophy, linguistics, communication, history, geography, demography, ethnicity, anthropology, archaeology, political science, law, education, criminology, and economy, just to name a few. Some social science topics are grouped in categories, such as individual or crowd, where studies tend to address the same categorical isssues. Still, social sciences are highly interchangeable. Sometimes, differences are a matter of interpretations based on the particular area(s) being considered.</p> <p class="sub-title">Social Science Contributions</p> <p class="contribution">Social sciences are not strictly confined to the above list. Studies in chemistry borrow concepts from sociology, anthropology, and economy. Mathematics and medicine, that are sometimes said not to be a science, regularly share theories with philosophy, psychology, or criminology. In the same way, it is practically impossible to study computer science, which includes computer languages and application programming, without referring to linguistics. As a conclusion, social sciences are not restricted to one area of study but contribute to various types of sciences, studies, and disciplines.</p> <p class="sub-title">Recommendations</p> <p class="paragraph">If you are planning to study any of the scocial science topics, find a good school.</p> <p>Schools | Majors | Minors</p> <p>Copyright © 2015</p> </body> </html> This would produce:
|