/    Sign up×
Community /Pin to ProfileBookmark

Position box with rounded corners?

I have found the following for a box with round corners. I can get it to work just fine. However, I can’t figure out how to specify an exact location on my page for the box to appear. I thought I would add
top: 85px;
left: 300px;
to it but I can’t figure out where to add it to make it place the box where I want it. Will someone assist me with this?
Thank you.

Here is the CSS:

/* */
*
html #tlc, * html #trc {height: 1%;}
/*
*/

body
{
margin: 0;
padding: 0;
background-color: white;
font-size: 100.01%;
text-align: center;
}

#box
{
position: relative;
margin-left: auto;
margin-right: auto;
margin-top: 3em;
padding: 0;
text-align: left;
width:80%; /* <– use this to tie width to viewport size */
width: 40em; /* <– use this for a set width */
background-color: #eeeeee;
}

#content
{
padding:3em;
}

#content h1
{
color:#0354c2;
font-weight: bold;
font-size: 1.2em;
font-family: helvetica, geneva, arial, sans-serif;
}

#content p
{
color:#3b3b3b;
font-size: 1em;
line-height: 1.3em;
font-family: arial, helvetica, sans-serif;
}

/* —=== border code follows ===— */
/*
tlc = top left corner
trc = top right corner
blc = bottom left corner
brc = bottom right corner
lb = left border
rb = right border
tb = top border
bb = bottom border
*
/

#tlc, #trc, #blc, #brc
{
background-color: transparent;
background-repeat: no-repeat;
}

#tlc
{
background-image:url(images/tlc.gif);
background-position: 0% 0%;
}

#trc
{
background-image:url(images/trc.gif);
background-position: 100% 0%;
}

#blc
{
background-image:url(images/blc.gif);
background-position: 0% 100%;
}

#brc
{
background-image:url(images/brc.gif);
background-position: 100% 100%;
}

#tb, #bb
{
background-color: transparent;
background-repeat: repeat-x;
}

#tb
{
background-image:url(images/tb.gif);
background-position: 0% 0%;
}

#bb
{
background-image:url(images/bb.gif);
background-position: 50% 100%;
}

#rb
{
background-image:url(images/r.gif);
background-position: 100% 0%;
background-repeat: repeat-y;
}

#lb
{
background-color: #eeeeee;
background-image:url(images/l.gif);
background-position: 0% 100%;
background-repeat: repeat-y;
}

Here is the HTML:

<div id=”box”>

<!— box border –>
<div id=”lb”>
<div id=”rb”>
<div id=”bb”><div id=”blc”><div id=”brc”>
<div id=”tb”><div id=”tlc”><div id=”trc”>
<!– –>

<div id=”content”>
<h1>Simple Box by tedd</h1>

<p>
View the source code via your browser.
</p>

</div>

<!— end of box border –>
</div></div></div></div>
</div></div></div></div>
<!– –>

</div>

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@PaBauthorDec 23.2006 — Well, I guess I must have been too tired. I looked again after a nights rest and I found my problem. I didn't place the

position: absolute;

before the

top: 85px;

left: 300px;

I got it working.
×

Success!

Help @PaB spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...