A Conversation for Website Developer's Forum

CSS positioning

Post 1

Santragenius V

I've got this design in a very initial phase -

http://www.lindevej.dk/capptest/

My problem is that the content boxes comes too far about as the top margin is set at 100 px to get the top one placed where it should be:

.content {
position:relative; /* Position is declared "relative" to gain control of stacking order (z-index). */
width:auto;
min-width:120px;
margin:100px 210px 0px 170px;
border:1px #CCCCCC solid;
background-color:transparent;
padding:5px;
z-index:3; /* This allows the content to overlap the right menu in narrow windows in good browsers. */
}

I've tried playing around with adjacent selectors as well as first-child - but can't for the life of me make the first one go at 100px and the following ones at eg 10...

But then, I'm very new at advanced CSS... smiley - smiley


CSS positioning

Post 2

Pastey

Sorry, what's the actual problem?

smiley - rose


CSS positioning

Post 3

Santragenius V

The individual text boxes in the wide middle column are too far apart for my liking... that is, from the 1st to the 2nd there are 100px and I'd rather have 20 or something like that


CSS positioning

Post 4

Pastey

Do you mean between the bottom of one content box and the top of the next? Or between the link boxes and the content box?

smiley - rose


CSS positioning

Post 5

Santragenius V

Between the bottom of one content box and the top of the next - while keeping the distance between the first content box and the top of the window...


CSS positioning

Post 6

Pastey

Ah, right. I see what you mean, and where the problem arises.

I *think*, and without testing it I can't be sure, but if you declare a seperate style within the first content box, it should override the parent style.

So, you'd have...



for the first one.

And change the content style to have...

margin:0px 210px 0px 170px;

I think.

smiley - rose


CSS positioning

Post 7

Pastey

Check the figures are in the right order though smiley - winkeye

smiley - rose


CSS positioning

Post 8

Santragenius V

Yeah, I always look at those 4 numbers and say "errrr - which one's left, top, ... etc)? smiley - headhurts

That's probably what I'll do - even though my brother-in-law (who's very hardcore in all this) would frown over the fact that I'm not properly separating content from layout... smiley - winkeye

Thx smiley - cheers


CSS positioning

Post 9

C Hawke

Which is why on a sticky on my monitor I have "TRBL" and chant it to myself daily to remember smiley - biggrin

CH


CSS positioning

Post 10

Pastey

Good idea!

smiley - rose


CSS positioning

Post 11

Santragenius V

*hums to himself, "TRBL, TRBL, ... "*

smiley - zen


CSS positioning

Post 12

Pastey

I suppose to keep content seperate from layout you could always just create another class for the top content and assign that.

smiley - rose


CSS positioning

Post 13

DoctorMO (Keeper of the Computer, Guru, Community Artist)

Content specific Styles are as bad (and I think worse) then content that is styled.

better to introduce your class and do some modifiers with the style attribute,

-- DoctorMO --


CSS positioning

Post 14

Santragenius V

Thanks - I'm well on my way into the next phase smiley - smiley


CSS positioning

Post 15

DoctorMO (Keeper of the Computer, Guru, Community Artist)

Looking good, even though it's in gobbly gook.

-- DoctorMO --


CSS positioning

Post 16

Santragenius V

smiley - biggrin

Now I'm just considering how to put in images without ruining the whole thing smiley - winkeye

(I've got ideas - put other things take presedence just now so it'll be a couple of days before it moves again, methinks)

Thanks for help & feedback smiley - smiley


Key: Complain about this post