Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Elements r boxes
1. Boxes
HTML Elements are boxes.
They stretch out to fill the container they’re in - in
this case the <body> element.
And, they stack up like blocks.
<p> Call me Ishmael. Some years ago -- never mind how long
precisely -- having little or no money in my purse, and nothing
Call me Ishmael. Some years ago -- never mind how long precisely
particular to interest me on shore, I thought I would sail about -- having little or no money in my purse, and nothing particular to
a little and see the watery part of the world.;</p> interest me on shore, I thought I would sail about a little and see the
watery part of the world.
<p> It is a way I have of driving off the spleen, and regulat- It is a way I have of driving off the spleen, and regulating the circula-
tion. Whenever I find myself growing grim about the mouth; when-
ing the circulation. Whenever I find myself growing grim about ever it is a damp, drizzly November in my soul;
the mouth; whenever it is a damp, drizzly November in my
soul;</p>
2. Helpful styling Tricks
1 Margins - create space outside
the element.
<style type=”text/css”> Call me Ishmael. Some Some years ago -- never
years ago -- never mind mind how long precisely
how long precisely -- hav- -- having little or no money
#boxybox { ing little or no money in in my purse, and nothing
my purse, and nothing
margin-bottom:25px; particular to interest me
particular to interest me on
shore, I thought I would sail
margin-left:25px; on shore, I thought I about a little and see the
would sail about a little
} and see the watery part
watery part of the world.
of the world. It is a way
I have of driving off the spleen, and regulating the circulation.
</style> November in my soul; whenever I find myself involuntarily
pausing before coffin warehouses, and bringing up the rear of
<div id=”boxybox”>Some years ago -- never mind how long every funeral I meet; and especially whenever my hypos get
such an upper hand of
precisely -- having little or no money in my purse, and nothing particular
to interest me on shore, I thought I would sail about a little and see the
watery part of the world. </div>
You can specify top and right margins, as well.
3. Helpful styling Tricks
2 padding - creates space between the
element and its own edges.
<style type=”text/css”>
#boxybox {
Some years ago -- never mind
padding:25px; how long precisely -- hav-
} ing little or no money in my
purse, and nothing particular
to interest me on shore, I
</style> thought I would sail about a
little and see the watery part
of the world.
<div id=”boxybox”>Some years ago -- never mind how long
precisely -- having little or no money in my purse, and nothing particular
to interest me on shore, I thought I would sail about a little and see the
watery part of the world. </div>
4. Helpful styling Tricks
3 &
Height and width - what you’d expect
4 Borders - create borders along the edge.
<style type=”text/css”>
#boxybox { Some years ago -- never mind
height:200px; how long precisely -- hav-
ing little or no money in my
width:200px; purse, and nothing particular
border: solid 1px green; to interest me on shore, I
*
thought I would sail about a
padding:25px; little and see the watery part
} of the world.
</style>
<div id=”boxybox”>Some years ago -- never mind how long
precisely -- having little or no money in my purse, and nothing particular
to interest me on shore, I thought I would sail about a little and see the
watery part of the world. </div>
* For more information about creating CSS declarations for borders, see Chapter 14
of our text Learning Web Design