css question
Page 1 of 1
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Tue, 7th Aug 2012 01:23    Post subject: css question
Well, I've got my 2 divs inside a bigger div the way I want them, one next tot he other both float left.

BUT in a smaller window/resolution or if a sidebar opens in the browser the rightmost one has no room and gets moved below the left one Crying or Very sad And it looks like shit. Is there a way to tether/snap elements together to they don't move relative to each other ?
Back to top
dingo_d
VIP Member



Posts: 14555

PostPosted: Tue, 7th Aug 2012 07:59    Post subject:
Well try making them fixed (absolute or static position), not relative...


"Quantum mechanics is actually, contrary to it's reputation, unbeliveably simple, once you take the physics out."
Scott Aaronson
chiv wrote:
thats true you know. newton didnt discover gravity. the apple told him about it, and then he killed it. the core was never found.

Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Tue, 7th Aug 2012 08:32    Post subject:
How about using a table Troll Dad


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
garus
VIP Member



Posts: 34200

PostPosted: Tue, 7th Aug 2012 11:42    Post subject:
snip


Last edited by garus on Tue, 27th Aug 2024 21:45; edited 1 time in total
Back to top
outtanames




Posts: 1591

PostPosted: Tue, 7th Aug 2012 12:27    Post subject:
What you should do is pretty easy! The main div that contains the two divs must have a FIXED width because otherwise it's width is considered 'automatic' and then when you squeeze the window horizontally it reduces the main div width, thus the 2 divs cannot float in the same line. You don't need to mess with position properties. Many people mistake that as a solution but it really isn't in most cases.
Back to top
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Tue, 7th Aug 2012 16:12    Post subject:
Hehe, thanks guys, I just put a width:900px; property to my big div and now they stay where they should.

Do you guys use pixels or other units ? I'm worried about different browsers,system settings, resolutions etc.
Back to top
garus
VIP Member



Posts: 34200

PostPosted: Tue, 7th Aug 2012 17:00    Post subject:
snip


Last edited by garus on Tue, 27th Aug 2024 21:45; edited 1 time in total
Back to top
VGAdeadcafe




Posts: 22230
Location: ★ ಠ_ಠ ★
PostPosted: Wed, 8th Aug 2012 01:48    Post subject:
It's not from scratch, it's a few separate modules/addons for a big CMS. But I will keep that twitter bootstrap in mind.

But what measurement units are you guys using ?
Back to top
dingo_d
VIP Member



Posts: 14555

PostPosted: Wed, 8th Aug 2012 08:02    Post subject:
pixels usaly... Because of the screen resolutions...


"Quantum mechanics is actually, contrary to it's reputation, unbeliveably simple, once you take the physics out."
Scott Aaronson
chiv wrote:
thats true you know. newton didnt discover gravity. the apple told him about it, and then he killed it. the core was never found.

Back to top
garus
VIP Member



Posts: 34200

PostPosted: Wed, 8th Aug 2012 10:42    Post subject:
snip


Last edited by garus on Tue, 27th Aug 2024 21:45; edited 1 time in total
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Wed, 8th Aug 2012 10:51    Post subject:
Pixels, media queries to deal with lower resolutions. If we don't do a fluid layout we typically stick to 960 pixels wide, but otherwise we do stuff like we did on http://www.shift-4.com (resize your browser to see what happens for lower resolutions, there's 3 or 4 breakpoints on that particular site) Smile
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group