Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > css positioning question

Reply
Thread Tools

css positioning question

 
 
Leslie
Guest
Posts: n/a
 
      10-11-2003
After years of using tables for page layout I'm finally trying to
learn CSS. I'm following various tutorials, viewing source codes and
just trying out stuff. I'm pretty comfortable with the basic stuff,
but am stumped on how to position a specific graphic.

I'm building a page with a background with a 100px left border. (the
background image is 1500px wide to accommodate various browser
resolutions) I've got a 600px wide banner graphic that I want to
place at the top of the page and centered in the area that's to the
right of the page border.

If I use absolute positioning I'm presuming everyone viewing the page
will be viewing it at the same resolution I am. That obviously won't
be the case.

I'm guessing I should be using relative positioning, but how? What's
the code I should use?

This is probably a very basic question, but I can't find the answer to
what I want and I'm getting frustrated!

Thanks for any help!

Leslie

email address is invalid
 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      10-11-2003
Leslie <> wrote:

>I'm building a page with a background with a 100px left border. (the
>background image is 1500px wide to accommodate various browser
>resolutions)


Well those that lie between 700px an 1500px width at any rate...

>I've got a 600px wide banner graphic that I want to
>place at the top of the page and centered in the area that's to the
>right of the page border.
>
>If I use absolute positioning I'm presuming everyone viewing the page
>will be viewing it at the same resolution I am. That obviously won't
>be the case.
>
>I'm guessing I should be using relative positioning, but how? What's
>the code I should use?


I wouldn't use positioning at all.

..banner {
text-align: center;
margin-left: 100px;
}

<div class="banner"><img src="banner.gif" alt="Banner" width="600"
height="60"></div>

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
Richard
Guest
Posts: n/a
 
      10-11-2003
Steve wrote:

> Leslie <> wrote:


>>I'm building a page with a background with a 100px left border. (the
>>background image is 1500px wide to accommodate various browser
>>resolutions)


> Well those that lie between 700px an 1500px width at any rate...


>>I've got a 600px wide banner graphic that I want to
>>place at the top of the page and centered in the area that's to the
>>right of the page border.


>>If I use absolute positioning I'm presuming everyone viewing the page
>>will be viewing it at the same resolution I am. That obviously won't
>>be the case.


>>I'm guessing I should be using relative positioning, but how? What's
>>the code I should use?


> I wouldn't use positioning at all.


> .banner {
> text-align: center;
> margin-left: 100px;
> }


> <div class="banner"><img src="banner.gif" alt="Banner" width="600"
> height="60"></div>


> Steve



Here's one possible method you can try, which I did test out and it works:

Notice there is no dot before [body].

body { background-position:center;
background-image: url("image.gif");
background-repeat: no-repeat;
border-color:#0000ff;
border-left-width:100px;
}

..banner { position:absolute;
left:10px; top:10px;
height:130px; width:600px;
background-color:blue; <<< color by name or number. #0000ff or
rgb(0,0,255)
background-image: url("banner.jpg");
background-position:center;
background-repeat:no-repeat;
}

<body>
<div class="banner"> text goes here</div>
</body

In my testing though, I found that "border-left-width" produced a black
portion then gave a distorted coloring of the rest of the field.
If that happens to you, just create a a division the width desired and color
it as desired.

www.stonware.dk get the page builder as it has a library of tags and
attributes for html, javascript and even css.
and it's free.



 
Reply With Quote
 
Leslie
Guest
Posts: n/a
 
      10-11-2003
On Sat, 11 Oct 2003 19:45:20 +0100, Steve Pugh <> wrote:

>Leslie <> wrote:
>
>>I'm building a page with a background with a 100px left border. (the
>>background image is 1500px wide to accommodate various browser
>>resolutions)

>
>Well those that lie between 700px an 1500px width at any rate...


Hmmm... does anyone view at a resolution wider than 1500? I just hate
the thought of someone having my left border repeat at the right of
the screen. Tacky.....
>
>>I've got a 600px wide banner graphic that I want to
>>place at the top of the page and centered in the area that's to the
>>right of the page border.


>
>I wouldn't use positioning at all.
>
>.banner {
>text-align: center;
>margin-left: 100px;
>}
>
><div class="banner"><img src="banner.gif" alt="Banner" width="600"
>height="60"></div>


Works perfectly, Steve. Thank you!

This NG has been a godsend, and I thank everyone (OK, most everyone)
for being so generous with help and info. I'm sure I'll be back with
more questions as I delve deeper into CSS

Leslie
 
Reply With Quote
 
DU
Guest
Posts: n/a
 
      10-11-2003
Leslie wrote:

> After years of using tables for page layout I'm finally trying to
> learn CSS. I'm following various tutorials, viewing source codes and
> just trying out stuff. I'm pretty comfortable with the basic stuff,
> but am stumped on how to position a specific graphic.
>
> I'm building a page with a background with a 100px left border. (the
> background image is 1500px wide to accommodate various browser
> resolutions) I've got a 600px wide banner graphic that I want to
> place at the top of the page and centered in the area that's to the
> right of the page border.
>
> If I use absolute positioning I'm presuming everyone viewing the page
> will be viewing it at the same resolution I am. That obviously won't
> be the case.
>
> I'm guessing I should be using relative positioning, but how? What's
> the code I should use?
>
> This is probably a very basic question, but I can't find the answer to
> what I want and I'm getting frustrated!
>
> Thanks for any help!
>
> Leslie
>
> email address is invalid


Maybe it would be a good idea to provide an url of the page you're
working on. Just a thought. But you should not have to do this if you
feel this can not help your post or your webpage situation.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

 
Reply With Quote
 
Leslie
Guest
Posts: n/a
 
      10-11-2003
On Sat, 11 Oct 2003 14:43:44 -0500, "Richard" <anom@anom> wrote:

> Steve wrote:
>
> > Leslie <> wrote:


>>>I've got a 600px wide banner graphic that I want to
>>>place at the top of the page and centered in the area that's to the
>>>right of the page border.


>> I wouldn't use positioning at all.

>
>> .banner {
>> text-align: center;
>> margin-left: 100px;
>> }

>
>> <div class="banner"><img src="banner.gif" alt="Banner" width="600"
>> height="60"></div>

>
>> Steve

>
>
>Here's one possible method you can try, which I did test out and it works:
>
>Notice there is no dot before [body].
>
>body { background-position:center;
> background-image: url("image.gif");
> background-repeat: no-repeat;
> border-color:#0000ff;
> border-left-width:100px;
> }
>
>.banner { position:absolute;
> left:10px; top:10px;
> height:130px; width:600px;
> background-color:blue; <<< color by name or number. #0000ff or
>rgb(0,0,255)
> background-image: url("banner.jpg");
> background-position:center;
> background-repeat:no-repeat;
>}
>
><body>
><div class="banner"> text goes here</div>
></body
>
>In my testing though, I found that "border-left-width" produced a black
>portion then gave a distorted coloring of the rest of the field.
>If that happens to you, just create a a division the width desired and color
>it as desired.
>
>www.stonware.dk get the page builder as it has a library of tags and
>attributes for html, javascript and even css.
>and it's free.


Richard,

Thanks for the help. What Steve posted in an earlier post works so
I'm going to use it for now. I'm saving your example for my next
'new' page. Thank you!

The link you provided for the page builder is invalid. Did you mean
stoneware.dk? If so, I tried that and.... uh.... it's in Danish. ??

Leslie
 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      10-11-2003
Leslie wrote:

> Richard,


> Thanks for the help. What Steve posted in an earlier post works so
> I'm going to use it for now. I'm saving your example for my next
> 'new' page. Thank you!


> The link you provided for the page builder is invalid. Did you mean
> stoneware.dk? If so, I tried that and.... uh.... it's in Danish. ??


> Leslie


No comprende engle signoir?
Little item on the right side of the page has "english" written on it.
Click there and you'll understand better.
sorry about the typo.


 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      10-11-2003
In post <>
Leslie said...

> (the background image is 1500px wide to accommodate various browser
> resolutions)


if its a repeating image just cut the image down and use "repeat-y" to
only repeat it vertically.

--
brucie.
12/October/2003 06:45:49 am
 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      10-11-2003
Leslie wrote:

> On Sat, 11 Oct 2003 19:45:20 +0100, Steve Pugh <> wrote:


>>Leslie <> wrote:


>>>I'm building a page with a background with a 100px left border. (the
>>>background image is 1500px wide to accommodate various browser
>>>resolutions)


>>Well those that lie between 700px an 1500px width at any rate...


> Hmmm... does anyone view at a resolution wider than 1500? I just hate
> the thought of someone having my left border repeat at the right of
> the screen. Tacky.....


>>>I've got a 600px wide banner graphic that I want to
>>>place at the top of the page and centered in the area that's to the
>>>right of the page border.



>>I wouldn't use positioning at all.


>>.banner {
>>text-align: center;
>>margin-left: 100px;
>>}


>><div class="banner"><img src="banner.gif" alt="Banner" width="600"
>>height="60"></div>


> Works perfectly, Steve. Thank you!


> This NG has been a godsend, and I thank everyone (OK, most everyone)
> for being so generous with help and info. I'm sure I'll be back with
> more questions as I delve deeper into CSS


> Leslie


Once you get used to the coding of css, you'll wonder how you managed
without it.
Tables will get shelved entirely and you'll never use another one.


 
Reply With Quote
 
Leslie
Guest
Posts: n/a
 
      10-11-2003
On Sun, 12 Oct 2003 06:48:42 +1000, brucie <brucie->
wrote:

>In post <>
>Leslie said...
>
>> (the background image is 1500px wide to accommodate various browser
>> resolutions)

>
>if its a repeating image just cut the image down and use "repeat-y" to
>only repeat it vertically.


What would happen then if viewed at a resolution wider than 1500?

Leslie
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Newbie CSS Positioning Question/Direction Spartanicus HTML 0 01-25-2005 10:00 AM
Basic CSS positioning Question?? Spartanicus HTML 11 09-06-2004 04:58 AM
another CSS positioning question.... Leslie HTML 4 11-02-2003 02:21 AM
Positioning a table cell (not a css/div question) Pat Traynor HTML 3 09-24-2003 09:35 AM
Absolute Positioning (CSS Question) Matt Beckwith HTML 4 07-18-2003 10:47 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57