473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

css2-Layout with relative positioning and using negative values

Hi i like to make a complex layout with css.
All the content is inside a container div.

I like to get the following sequence without the css-layout:
logo
title
mainnav
content

i can only get the results when i use negative positioning.
Target browsers seem to have no problem with that.

Is this a good way or do i have a better possibility?

<div id="container" style="margin-left:auto ; marginauto-right: auto;
padding: 0px; width: 775px; font-family: Verdana, Arial, Helvetica,
sans-serif;
font-size: 80%;">
<div>
<div id="Layer1" style="position:relative; left:0px; top:0px;
width:230px; height:167px; z-index:1; background-image:
url(/img/main/pic-lo.jpg); layer-background-image:
url(/img/main/pic-lo.jpg); border: 1px none #000000;" align="left"></div>
<div id="Layer2" style="position:relative; left:143px; top:0px;
width:87px; height:200px; z-index:2; background-color: #FFCBCE;
layer-background-color: #FFCBCE; border: 1px none #000000;"></div>
<div id="Layer3" style="position:relative; left:143px; top:0px;
width:172px; height:90px; z-index:3; background-image:
url(/img/main/pic-txt.gif); layer-background-image:
url(/img/main/pic-txt.gif); border: 1px none #000000;"></div>
<div id="Layer4" style="position:relative; left:565px; top:-447px;
width:87px; height:71px; z-index:4"><img src="/img/logo-deswos.gif"
width="87" height="71" /></div>
</div>
<div id="title" style="position:absolute; left:314px; top:6px;
width:249px; height:110px; z-index:7">
<h1>Projekte in L&auml;ndern</h1>
</div>
<div id="mainnav" style="position:relative; left:0px; top:-350px;
width:130px; height:270px; z-index:8">navlist</div>
<div id="content" style="position:relative; left:325px; top:-360px;
width:340px; height:412px; z-index:5; background-color: #99FFCC;
layer-background-color: #99FFCC; border: 1px none #000000;">
<p><font class="normal">Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.</font></p>

</div>
<div id="Layer5" style="position:relative; left:492px; top:0px;
width:219px; height:90px; z-index:6"><img
src="/img/main/aktuelles-ru.jpg" width="262" height="160" /></div>

</div>
Jul 20 '05 #1
1 5344
Wilhelm Kutting wrote:
Hi i like to make a complex layout with css.
All the content is inside a container div.

I like to get the following sequence without the css-layout:
logo
title
mainnav
content

i can only get the results when i use negative positioning.
Target browsers seem to have no problem with that.

Is this a good way or do i have a better possibility?

<div id="container" style="margin-left:auto ; marginauto-right: auto;
padding: 0px; width: 775px; font-family: Verdana, Arial,
Helvetica, sans-serif;
font-size: 80%;">
So, you're forcing 775px width on me, as well as a font smaller than I
have chosen as my preference. Thanks a bunch.

What's marginauto-right?
<div>
<div id="Layer1" style="position:relative; left:0px; top:0px;
width:230px; height:167px; z-index:1; background-image:
url(/img/main/pic-lo.jpg); layer-background-image:
url(/img/main/pic-lo.jpg); border: 1px none #000000;" align="left"></div>
Layer1. Descriptive name - I like it. I don't see layer-background-image
in the CSS specs.
<div id="Layer2" style="position:relative; left:143px; top:0px;
width:87px; height:200px; z-index:2; background-color: #FFCBCE;
layer-background-color: #FFCBCE; border: 1px none #000000;"></div>
Layer2: another good name choice.
<div id="Layer3" style="position:relative; left:143px; top:0px;
width:172px; height:90px; z-index:3; background-image:
url(/img/main/pic-txt.gif); layer-background-image:
url(/img/main/pic-txt.gif); border: 1px none #000000;"></div>


Layer3: I didn't see that coming. I'm getting bored chasing this lot
through. My guess is that position: relative is confusing you. Please
post a URL so that we can take a look at what is happening using real
tools like Firefox's Web Developer Toolbar.

Make sure your code validates first.

--
Mark.
http://tranchant.plus.com/
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: FC | last post by:
Hello folks, anyone who knows if the hover pseudo class applies only to anchor (<A/>) elements or to basic shapes as well? In either case I could not find a way to get Adobe SVG Viewer 3.0 to...
4
by: Neil Zanella | last post by:
Hello, I would like to know what the major enhancements of CSS2 over CSS1 are and whether CSS2 support is any better these days than it was a few years ago. In particular, do most browsers fully...
6
by: Patrick | last post by:
Hi I am a newbie struggling a little with css.It is hard to get it right in all browsers, so i decided to read the CSS2 specification on the w3 site. What is the following from the CSS2...
14
by: Michael Bulatovich | last post by:
Has anyone got a good link to a concise discussion of where things now stand regarding these two? e.g. What browsers are compliant with one or the other? What the adoption rate is of these...
8
by: Franck | last post by:
Hi, I'm having problems with css2/xhtml based form. I didn't find examples to see what can be done, especially textarea. How to define cols="45" rows="4" in css?
2
by: Jan Roland Eriksson | last post by:
The following URL... <http://www.w3.org/TR/CSS21/> ....has had the following text in it for a considerable time now. "This is a W3C Candidate Recommendation, which means the specification...
2
by: Xah Lee | last post by:
what's new in CSS2? http://xahlee.org/js/css2.html Xah xah@xahlee.org ∑ http://xahlee.org/
2
by: David E. Ross | last post by:
A new working draft of the CSS2.1 specification was published on-line on 11 April. Does anyone know what changed since the previous (13 June 2005) working draft? -- David E. Ross...
4
by: maya | last post by:
I'm trying to learn CSS2, find some aspects of it quite confusing.. here, http://www.w3.org/TR/REC-CSS2/selector.html#q1 I see this: E F : Matches any F element that is a descendant of an E...
1
by: Jean Pierre Daviau | last post by:
Hi, I am looking for a pdf version of CSS2.1 Specification Thanks -- Jean Pierre Daviau
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.