Welcome to Dream.In.Code
Become an Expert!

Join 149,720 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,278 people online right now. Registration is fast and FREE... Join Now!




Border will not go around content/text. Please help!

 
Reply to this topicStart new topic

Border will not go around content/text. Please help!, Border does not appear around the text as it should, stays at bottom o

Audioicon
3 Feb, 2007 - 01:12 AM
Post #1

New D.I.C Head
*

Joined: 6 Dec, 2006
Posts: 8


My Contributions
I know this is an elementary question but hey! Everybody needs a start! So Thanks for reading this.

I'm starting to learn html/xhtml/css and this is my first lesson.
I worked on this little page but cannot get the border to wrap or fit around the text as part of the design.

The code is below, html/css. Please help and indicate what changes you made to solve the problem.

Thanks everyone.

I'm currently using Explorer 7, the code are below.

Thanks very much.

<html>
<head>
<title>Starbuzz Coffee</title>
<style type="text/css">
body
{
background-color: #d2b49c;
margin-left: 20%;
margin-right: 20%;
border: 1px dotted gray;
padding: 10px 10px 10px 10px;
font-family: sans serif;
}
</style>
</head>
<body>
<h1>Starbuzz Coffee Beverages</h1>
<h2>House Blend, $1.49</h2>
<p>A smooth, mild blend of coffees from Mexico,
Bolivia and Guatemala.</p>

<h2>Mocha Cafe Latte, $2.35</h2>
<p>Expresso, steamed milk and chocolate syrup.</p>

<h2>Cappuccino, $1.89</h2>
<p>A mixture of expresso, steamed milk and foam.</p>

<h2>Chai Tea, $1.85</h2>
<p>A spicy drink made with black tea,
spices, milk and honey.</p>
</body>
</html>


User is offlineProfile CardPM
+Quote Post

rockstar_
RE: Border Will Not Go Around Content/text. Please Help!
3 Feb, 2007 - 10:57 PM
Post #2

D.I.C Head
Group Icon

Joined: 16 Oct, 2006
Posts: 187


Dream Kudos: 275
My Contributions
Audioicon-

It helps best if you wrap your code in the code tags from the RTE that we use at DIC. Take a look at what I changed. Instead of writing "gray" in your border declaration, why not use the hex color? I'm not sure if IE7 has the "gray" constant in its CSS spec, but I would say it's generally a better idea to use the hex color than the string. This worked for me in my IE7 browser.
CODE

<style type="text/css">
body
{
background-color: #d2b49c;
margin-left: 20%;
margin-right: 20%;
border: 1px dotted #888888;
padding: 10px 10px 10px 10px;
font-family: sans serif;
}
</style>



User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 04:50AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month