The Borders of a Box or Element Instead individually specifying the thickness, and the color, and the style of a border, CSS provides a style named border that combines all three styles. The formula to follow is: border: width style color Here is an example: <html> <head> <title>Social Science Studies</title> <style> #main-title { border: 10px groove Navy; font-weight: bold; height: 1.38em; color: #F00; font-size: 2.24em; text-align: center; background-color: Bisque; text-shadow: 0.10cm 0.10cm 0.02cm Black; font-family: Bodoni MT Black, Georgia, Times New Roman, serif; } #introductory { border: 0.2cm ridge DarkGreen; color: #000; text-align: left; font-size: 1.24em; background-color: PaleTurquoise; font-family: Times New Roman, Garamond, Times, serif; } #recommendation { border: 0.75em inset Peru; color: Yellow; text-align: left; font-size: 1.24em; background-color: Navy; font-family: Times New Roman, Garamond, Times, serif; } </style> </head> <body> <p id="main-title">Social Science Studies</p> <section id="introductory"> <p>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. Some social science topics are grouped in categories, such as individual or crowd, where studies tend to address the same categorical isssues.</p> </section> <footer id="recommendation"> <p>If you are planning to study any of the scocial science topics, find a good school.</p> <p style="text-align: center">Copyright © 2015</p> </footer> </body> </html> This would produce: Borders by Sides Introduction As mentioned in our introduction to boxes, a box or an element has four sides: left, top, right, and bottom. Based on the three fundamental characteristics of a side, CSS allows you to manage its side individually. Each style of a border has a specific name. It starts with border, followed by -, and followed by the designating side. The Style of a Border Each side has its own border element and a border style can be applied to that side. Each side has an adapted name and they are:
Each style follows the same rules we reviewed for the borders of a box. The Color of a Border All sides of a box or element can be painted with the same color or each side can have its own color. The names of the styles to apply a color to each side are:
The value of the style can any valid color. The Thickness of a Border Every side of a box can have the desired thickness for the line drawn on it. The names of the thickness styles are:
The thickness can be a name (medium, thin, or thick) or an HTML-based number. The Style of a Border Instead of accessing the individual styles of each side, CSS provides a name for each border. The border for the left side of a box or element is named border-left. The value of the style is in the form: width style color Here is an example of using this style: <html>
<head>
<title>Social Science: Philosophy</title>
<style type="text/css">
.main-title
{
font-weight: bold;
color: Black;
font-size: 1.26cm;
text-align: center;
text-shadow: 0.14cm 0.14cm 0.12cm Silver;
font-family: Bodoni MT Black, Georgia, Times New Roman, serif;
}
#title-banner, #central, #bottom-banner { width: 600px }
.description
{
font-size: 12pt;
text-align: justify;
font-family: Calibri, AvantGarde BkBT, Arial, sans-serif;
}
#navigator { width: 600px }
.link-box
{
float: left;
text-align: center;
}
#navigator a:link, #navigator a:active,
#navigator a:visited, #navigator a:hover
{
border-left: 1pt solid #99CCFF;
height: 35px;
text-decoration: none;
width: 90pt;
line-height: 2.00em;
display: inline-block;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
#navigator a:link
{
color: Aqua; /* #FFCC00; */
background-color: #00254A; /* #8CC6FF*/
}
#navigator a:active { color: #999966 }
#navigator a:visited { color: #FF99FF }
#navigator a:hover
{
color: #FFFF99;
background-color: #004080 /*, #3399FF, #004080);*/
}
#navigator p
{
width: 90pt;
color: #FFFF99;
}
.philosophic
{
display: table;
outline: 3pt gray groove;
}
.philo-heading { display: table-row }
.philo-field, .philo-topic, .philo-issues,
.philo-value1, .philo-value2
{
height: 20pt;
line-height: 20pt;
display: table-cell
}
.philo-field, .philo-topic, .philo-issues
{
background-color: #333333;
outline: 1pt solid Gray;
}
.philo-field { width: 110pt }
.philo-topic { width: 70pt }
.philo-issues2 { width: 200pt }
.philo-title
{
height: 26pt;
line-height: 26pt;
font-weight: bold;
color: white;
font-family: "Comic Sans MS", Tahoma, sans-serif;
}
.philo-value2
{
background-color: Silver;
outline: 1pt solid #FFF;
}
#bottom-banner
{
background: linear-gradient(#004080, #0066FF);
outline: 2pt solid #FFBE00;
}
#copyright
{
line-height: 2.00em;
text-align: center;
color: #FFCC00;
outline: 1pt solid orange;
}
#branches, #history, #resources { float: left }
#branches a:link, #branches a:active, #branches a:visited, #branches a:hover,
#history a:link, #history a:active, #history a:visited, #history a:hover,
#resources a:link, #resources a:active, #resources a:visited, #resources a:hover
{
height: 26px;
font-size: 12pt;
line-height: 26px;
text-decoration: none;
display: inline-block;
font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
}
#branches, #branches a:link, #branches a:active,
#branches a:visited, #branches a:hover { width: 170px }
#history, #history a:link, #history a:active,
#history a:visited, #history a:hover { width: 150pt }
#resources, #resources a:link, #resources a:active,
#resources a:visited, #resources a:hover { width: 165pt }
#branches a:link, #history a:link, #resources a:link { color: #FFFF00 }
#branches a:active, #history a:active, #resources a:active { color: #CC99FF }
#branches a:visited, #history a:visited, #resources a:visited { color: #FFCC99 }
#branches a:hover, #history a:hover, #resources a:hover
{
color: #FFCCFF;
background-color: #0066CC;
display: inline-block;
outline: 1pt solid #CCFF33;
}
.clearance { clear: left }
</style>
</head>
<body>
<div id="title-banner">
<p class="main-title">Philosophy</p>
</div>
<div id="navigator">
<p class="link-box"><a href="index1.htm">Home</a></p>
<p class="link-box"><a href="research.htm">Research</a></p>
<p class="link-box"><a href="resources.htm">Resources</a></p>
<p class="link-box"><a href="aboutus.htm">About Us</a></p>
<p class="link-box"><a href="contact.htm">Contact Us</a></p>
</div>
<div class="clearance"></div>
<div id="central">
<p class="description">Philosophy is the study of existense (or being),
knowledge (or reasoning), and truth. Philosophy seeks to comprehend what
truth is, how to evaluate it, and how it influences thoughts and ethics.
Like other social science topics such as sociology or psychology, philosophy
examines both personal and crowd behavior but only as they relate to the
mind. An example is the thinking process that results in someone taking one
action rather than another (another person taking the same action or another
person taking a different action). Unlike the other social science fields,
philosophy doesn't concentrate on what is good or bad, or what is practical
or weird, or on how something should (is supposed to) be. Instead,
philosophy delves into the logic and the ethical reasons of what it (such
as something or a behavior) is.</p>
<p class="description">Some of the most regular fields of study in philosophy
are:</p>
</div>
<div class="philosophic">
<div class="philo-heading">
<div class="philo-field philo-title">Philosophic Field</div>
<div class="philo-topic philo-title">Topic</div>
<div class="philo-issues philo-title">Issues</div>
</div>
<div class="philo-heading">
<div class="philo-value1">Epistemology</div>
<div class="philo-value1">Knowledge</div>
<div class="philo-value1">Truth, perception, belief, justification</div>
</div>
<div class="philo-heading">
<div class="philo-value2">Logic</div>
<div class="philo-value2">Reason</div>
<div class="philo-value2">Deduction (deductive reasoning)<br>
Induction (inductive reseaning)</div>
</div>
<div class="philo-heading">
<div class="philo-value1">Metaphysics</div>
<div class="philo-value1">Reality</div>
<div class="philo-value1">Existence, time, causality</div>
</div>
<div class="philo-heading">
<div class="philo-value2">Aesthetics</div>
<div class="philo-value2">Beauty</div>
<div class="philo-value2">Art, beauty, taste</div>
</div>
</div>
<footer id="bottom-banner">
<div id="branches">
<p><a href="natural.htm">Natural Philosophy</a><br>
<a href="physical.htm">Physical Philosophy</a><br>
<a href="moral.htm">Moral Philosophy</a></p>
</div>
<div id="history">
<p><a href="philosophers.htm">Philosophers</a><br>
<a href="comparisons.htm">Ancient/Contemporary</a><br>
<a href="majors.htm">Universities</a></p>
</div>
<div id="resources">
<p><a href="philosophers.htm">Philosophers</a><br>
<a href="comparisons.htm">Ancient/Contemporary</a><br>
<a href="majors.htm">Universities/Colleges/Majors</a></p>
</div>
<p id="copyright">Copyright ©, 2015</p>
</footer>
</body>
</html>
This would produce: The style used to control the bottom border of a box or section is named border-bottom. It also takes values for the line type, the color, and the thickness. Here are examples of using it: <!DOCTYPE html> <html> <head> <title>Psychology</title> <style> background: radial-gradient(at 75%, #400, Bisque); } #top-portion, #bottom-portion { width: 625px } #top-title { text-align: center; color: rgb(255, 250, 250); border-bottom: 2pt dotted #400; text-shadow: 0.14cm 0.14cm 0.12cm #400; font: bold 28pt Bodoni, Elephant, Times, serif; } .description { color: #400; text-align: justify; font: normal 14pt Times New Roman, Garamond, Times, serif; } #links-bar { height: 32px } #bottom-portion { background: linear-gradient(270deg, rgb(175, 85, 10) 50%, #400 90%, rgb(175, 85, 10) 100%); } } #links-bar { background-color: rgb(175, 85, 10) } #links-bar p { float: right } a.lnk-btn:link, a.lnk-btn:active, a.lnk-btn:visited, a.lnk-btn:hover { height: 32px; line-height: 32px; font-size: 14px; text-decoration: none; width: 70pt; text-align: center; outline: 1pt solid rgb(255, 155, 0); font-family: Meiryo, Segoe UI, sans-serif } a.lnk-btn:link { background-color: #400; display: inline-block; color: rgb(255, 155, 0); } a.lnk-btn:active { color: rgb( 0, 255, 255) } a.lnk-btn:visited { color: rgb(102, 155, 255) } a.lnk-btn:hover { color: rgb(255, 255, 0); background-color: rgb(175, 85, 10); } #dealing, #exploration, #resources { float: left; width: 145pt; } #exploration, #resources { border-left: 1pt dashed #FFFFcc; } #bottom-portion { height: 160px } #dealing ul, #exploration ul, #resources ul { list-style-type: none; } #dealing a:link, #dealing a:active, #dealing a:visited, #dealing a:hover, #exploration a:link, #exploration a:active, #exploration a:visited, #exploration a:hover, #resources a:link, #resources a:active, #resources a:visited, #resources a:hover { text-decoration: none; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif } #dealing a:link, #exploration a:link, #resources a:link { color: #FFCC00; } #dealing a:active, #exploration a:active, #resources a:active { color: #999966 } #dealing a:visited, #exploration a:visited, #resources a:visited { color: #FF99FF } #dealing a:hover, #exploration a:hover, #resources a:hover { color: #FFFF99; text-decoration: underline; } .psychohead { display: block; color: Orange; font-weight: bold; font-size: 14pt; border-left: 1pt dashed white; border-bottom: 1pt dashed white; } #bottom-portion { bottom: 0; top: auto; height: auto; position: absolute; } .clearer { clear: right } </style> </head> <body> <div id="top-portion"> <p id="top-title">Psychology</p> </div> <div id="links-banner"> <div id="links-bar"> <p><a class="lnk-btn" href="aboutus.htm">About Us</a></p> <p><a class="lnk-btn" href="library.htm">Library</a></p> <p><a class="lnk-btn" href="academia.htm">Academia</a></p> <p><a class="lnk-btn" href="socialsciences/index.htm">Home</a></p> </div> </div> <div class="clearer"></div> <div class="container"> <p class="description">Psychology is a social science field that focuses on the mind as it relates to human thoughts and behaviors. On one hand, psychology gets inputs from sociology, philosophy, medicine, and ethnicity, etc. on the other hand, psychology has a great influence on all sciences that deal with personal views and actions.</p> <p class="description">Psychology does not exclusively targets the individual but it also considers any aspect in the person's environment. As a matter of facts, there are various fields of studies that derive from psychology.</p> </div> <div id="bottom-portion"> <div id="bottom-container"> <div id="dealing"> <ul> <li class="psychohead">Dealing With ...</li> <li><a href="healing.htm">Healing</a></li> <li><a href="leadership.htm">Leadership</a></li> <li><a href="addictions.htm">Addictions</a></li> <li><a href="self-esteem.htm">Self-Esteem</a></li> <li><a href="achievements.htm">Achievements</a></li> </ul> </div> <div id="exploration"> <ul> <li class="psychohead">Exploring ...</li> <li><a href="psychotherapy.htm">Psychotherapy</a></li> <li><a href="therapy.htm">Family Therapy</a></li> <li><a href="communication.htm">Communication</a></li> <li><a href="politics.htm">Political Science</a></li> </ul> </div> <div id="resources"> <ul> <li class="psychohead">Resources</li> <li><a href="education.htm">Education/Degrees</a></li> <li><a href="professions.htm">Professions</a></li> <li><a href="helplines.htm">Help Lines</a></li> <li><a href="online.htm">Online Resources</a></li> </ul> </div> </div> </div> </body> </html> The style to set the top border of a box is named border-top and it takes the same types of values as the other two styles used above. Here is an example: #bottom-portion { bottom: 0; top: auto; height: auto; position: absolute; border-top: 3pt solid #400; } Finally, the style that controls the right border of an element is border-right. Here is an example of setting it (you can put the following line anywhere between the style and the lines in the head section: #resources { border-right: 1pt dashed #FFFFcc } The Corners of a Box Introduction The corner of a box is the intersection of two adjacent borders. By default, the corner of a box is drawn as a 90° angle. CSS allows you to round a corner to a radius of your choice. You have various options to manage the top-left, the top-right, the bottom-right, and the bottom-left corners:
The Radius a Corner A corner is created by setting the radius by which to draw an arc on the corner. The arc is drawn as a quarter of a circle. In order to draw that arc, you must indicate the corner on which you want to work. Each corner has a name that is a combination of border, followed by -, followed by a designation of the conrner, and ending with -radius. The style names are:
An arc is drawn by specifying a radius for its circle. The value can be set by:
|