Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer night - @98.08
Activity rating: Four Stars Posts & Arts: 63/1k.beats Random | Recent Posts | Guild Recents
News: ozwomp is requesting your location :ozwomp: [Agree] Guild Events: Summer Projects

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Best way to have a 2 column site?


« previous next »
Pages: [1] Print Embed
Author Topic: Best way to have a 2 column site?  (Read 4504 times)
Obspogon
Full Member ⚓︎
***
View Profile WWW


gamer
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: obspogon
iMood: Obspogon
Matrix: Chat!
XMPP: Chat!

Guild Memberships:
Artifacts:
First 1000 Members!OG! Joined 2021!
« on: an Autumn night » Embed

I want to have a homepage with 2 columns of unequal width but the same height.

Logged

----------------------
https://obspogon.neocities.org/
----------------------
https://card.exophase.com/2/0/272714.png?1737474560
Melooon
Hero Member ⚓︎
*****
View Profile WWWArt


So many stars!
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
You're a Star!I got robbed by Dan Q on Melonland!Flinstone VitaminAlways working hard!Known Apple shillcoolest melon on the web!
« Reply #1 on: an Autumn night » Embed

The new school way would be to use flex, although that's designed for sites that have dynamic width.
Which you can read about here: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

If you wanna do it the old way you can make both columns float left, then set a fixed width for each (you can also do a % width for dynamic sizing)

Something like: Untested sample code to give an idea, may not directly work! This will create 2 columns that should always be 100% the height of the wrapper, so in theory as the wrapper expands, so will both columns.

Code

<div id="wrapper">
 <div id="col-a"></div>
 <div id="col-b"></div>
</div>

#wrapper {
 width: 700px;
 margin: 0px auto 0px auto;
}

#col-a, #col-b {
 float: left;
 height: 100%;
}

#col-a {
 width: 200px;
}

#col-b {
 width: 500px;
}


Logged


everything lost will be recovered, when you drift into the arms of the undiscovered

Artifact Swap: Visited on Melon's 10th Anniversary!Wildflowers!bitsy catRed TulipMellohiI met Dan Q on Melonland!?Flowers
Obspogon
Full Member ⚓︎
***
View Profile WWW


gamer
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: obspogon
iMood: Obspogon
Matrix: Chat!
XMPP: Chat!

Guild Memberships:
Artifacts:
First 1000 Members!OG! Joined 2021!
« Reply #2 on: an Autumn night » Embed

Used the flex method and it works now. Thanks.

Logged

----------------------
https://obspogon.neocities.org/
----------------------
https://card.exophase.com/2/0/272714.png?1737474560
fLaMEd
Jr. Member ⚓︎
**
View Profile WWW

⛺︎ My Room

Artifacts:
First 1000 Members!OG! Joined 2021!
« Reply #3 on: a Winter night » Embed

If you wanna do it the old way you can make both columns float left, then set a fixed width for each (you can also do a % width for dynamic sizing)

Scream/Lol, why would you want to do it the old way haha! 

Like going for a run with a weight vest :joy:

Logged
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 MelonLand Zap! Want to Login or Join ? Forum Art Hub Chat Webring Editor Recent Edits Tenement Arcade Web Guides Graphics Catalogue Wiki Newsletters Image Stream
Melon's Sites TamaNotchi Textures PixelSea GifyPet MoMG Ozwomp Online Loom Videos Leaky Webring Melonking
Tools Melon Software ArtHub Embed Maker ML Passports
Outlinks Webrings Internet Phone Book HTML Energy Declarations Hackers & Designers Frutiger Aero Forum m15o's Web Services 32Bit Cafe iMood
Minecraft: Online
Join: craft.melonking.net