473,394 Members | 1,746 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,394 software developers and data experts.

Layout Breaking Up With Stretchable Content

PB
Hi,

I need some CSS layout guidance because I think I've been staring at
this too long!

I designed my layout using Photoshop, then sliced everything up and
saved as a CSS web page.

My problem arises when I started re-coding the html and CSS. My
graphics begin to break up at the bottom with large gaps and wrong
placement.

I need the top graphics to stay at the top, middle graphics to stretch
depending on the amount of content (this is where the problem seems to
arise) and the bottom graphics to stay at the bottom.

To clarify, the layout I have is something like this (T=top, M=middle,
B=bottom):
TTTT
TMMT
MMMM
BMMB
BBBB

Hope that looks OK in this posting - the letter spacing may be a bit
off but I hope you get the idea. This is what it looks like broken up
(to the right is the makeup of the separate graphic files):
TTTT T TT T
T T = T T

MM MM
MMMM = M MM M
MM MM

B B B B
BBBB = B BB B

To clarify, the top, middle and bottom sections all consist of 3
graphic sections (each having a left, middle and right graphic slice) -
i.e., there are pretty much 9 graphic elements in total.
The top protrudes down and bottom protrudes upwards, with the two outer
middle sections as stretching borders encompassing the content. As I
was saying, the middle sections ('M')needs to be stretchable to
accommodate variable content.

Is anyone aware of a CSS template or other solution that would put me
out of my misery? Even a few pointers to existing pages that have a
similar layout would be great. I've been hacking at positioning with
absolute and relative but not getting anywhere.

Thanks in advance for any help!

Oct 30 '06 #1
7 2799
PB
I just realised the TMB layout I described doesn't show up very well in
the posting - needs a blocked console font to see it properly. I
promise you I'm not throwing random text at the page! Copy the text and
paste it into notepad to see it more clearly.

PB wrote:
Hi,

I need some CSS layout guidance because I think I've been staring at
this too long!

I designed my layout using Photoshop, then sliced everything up and
saved as a CSS web page.

My problem arises when I started re-coding the html and CSS. My
graphics begin to break up at the bottom with large gaps and wrong
placement.

I need the top graphics to stay at the top, middle graphics to stretch
depending on the amount of content (this is where the problem seems to
arise) and the bottom graphics to stay at the bottom.

To clarify, the layout I have is something like this (T=top, M=middle,
B=bottom):
TTTT
TMMT
MMMM
BMMB
BBBB

Hope that looks OK in this posting - the letter spacing may be a bit
off but I hope you get the idea. This is what it looks like broken up
(to the right is the makeup of the separate graphic files):
TTTT T TT T
T T = T T

MM MM
MMMM = M MM M
MM MM

B B B B
BBBB = B BB B

To clarify, the top, middle and bottom sections all consist of 3
graphic sections (each having a left, middle and right graphic slice) -
i.e., there are pretty much 9 graphic elements in total.
The top protrudes down and bottom protrudes upwards, with the two outer
middle sections as stretching borders encompassing the content. As I
was saying, the middle sections ('M')needs to be stretchable to
accommodate variable content.

Is anyone aware of a CSS template or other solution that would put me
out of my misery? Even a few pointers to existing pages that have a
similar layout would be great. I've been hacking at positioning with
absolute and relative but not getting anywhere.

Thanks in advance for any help!
Oct 30 '06 #2
On 2006-10-30, PB wrote:
I just realised the TMB layout I described doesn't show up very well in
the posting - needs a blocked console font to see it properly. I
promise you I'm not throwing random text at the page! Copy the text and
paste it into notepad to see it more clearly.
What's notepad?

What we need is a URL.
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Oct 30 '06 #3
On 2006-10-30, PB <pb******@googlemail.comwrote:
[snip]
To clarify, the layout I have is something like this (T=top, M=middle,
B=bottom):
TTTT
TMMT
MMMM
BMMB
BBBB

Hope that looks OK in this posting - the letter spacing may be a bit
off but I hope you get the idea. This is what it looks like broken up
(to the right is the makeup of the separate graphic files):
TTTT T TT T
T T = T T

MM MM
MMMM = M MM M
MM MM

B B B B
BBBB = B BB B

To clarify, the top, middle and bottom sections all consist of 3
graphic sections (each having a left, middle and right graphic slice) -
i.e., there are pretty much 9 graphic elements in total.
The top protrudes down and bottom protrudes upwards, with the two outer
middle sections as stretching borders encompassing the content. As I
was saying, the middle sections ('M')needs to be stretchable to
accommodate variable content.
There are two ways you can make an image stretch. One is to use an img
element, but set width and height on it. The UA does some (poor quality
compared to programs like Photoshop) scaling.

Or use a div with background-image, and use the background-repeat
property to tile the image. If the image is a repeating wallpaper type
of pattern, then this is probably better.

Your ASCII diagrams came out fine. And it sounds like your positioning
is working because the corners are staying put.
Oct 30 '06 #4
PB wrote:
>
I designed my layout using Photoshop, then sliced everything up and
saved as a CSS web page.
This is a horrible way to construct a web page. A graphics program has
no business generating HTML or CSS.
I've been hacking at positioning with
absolute and relative but not getting anywhere.
This is the best way to make a layout that falls apart at the slightest
nudge. Take the time to learn how positioning methods really work
instead of hacking away, please. That includes the box model and floats.

I'm not trying to discourage you from doing your own coding, I just want
to emphasize that CSS isn't something you can learn overnight and you
can make a real mess of things if you don't know what you are doing.

--
Berg
Oct 30 '06 #5
PB
Hi all, thanks for the advice.

Have it all sort now. Took a few hours of perseverance before things
started to click in my head (or maybe it was a large "CLUNK!"). I
haven't used CSS to any great extent before, which is why I found it a
little frustrating, but now I have seen the light (and have since
stopped whimpering when things started to go all Picasso on me).

Working with Photoshop was actually quite useful. It pumped out all the
dimensions of the graphic shapes in absolute form for me, which was
very handy. I was under no illusion that it would do all the work for
me (I actually prefer working in code rather than a design view). It
was getting an understanding of absolute and relative positioning that
took a bit of time to sink in (I initially thought it it had to be
either absolute or relative but not both - now I'm aware that they can
be mixed together).

Here's a description of the solution I came up with:
I created absolute positioning for each of the three sections (top,
middle and bottom) to make the graphic elements stick together (a bit
like glue) and used wrapper DIVs to keep them self contained.

I then used a bit of relative positioning on these wrapper DIVs to make
them work flexibly together with a slight dash of absolute positioning.

My biggest piece of advice would be to get out a pen and piece of paper
to draw out how the various wrappers should work together. When
elements start mounting up it won't take much for a DIV to go astray.

PB.

Oct 31 '06 #6
PB wrote:
>
I created absolute positioning for each of the three sections (top,
middle and bottom) to make the graphic elements stick together
I can see it now - at my largish default text size, the 3 sections will
start overlapping. :-(

--
Berg
Oct 31 '06 #7
PB
I can see it now - at my largish default text size, the 3 sections will
start overlapping. :-(
Nope - just tested with a lot of text and very large fonts. No
overlapping. :-)

Nov 1 '06 #8

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

Similar topics

39
by: Zak McGregor | last post by:
Hi all Are there any good solutions to aligning form field names and input boxes without resorting to tables? I am struggling to do this nicely at the moment. Thanks Ciao Zak
2
by: CJM | last post by:
I'm developing a site for a charity which I am aiming to make standards-compliant, accessible and cross-browser compatible. I'm doing OK so far and have the workings of a respectable site, but I...
27
by: Curtis Morrison | last post by:
Please help! I've been trying to figure this out for days now, with no luck. the following web page loads fine in MSIE, but NN 7 breaks it. I would really appreciate any suggestions that anyone...
15
by: Gary Peek | last post by:
Can anyone tell us the browsers/versions that exhibit errors when tables are nested too deeply? And how many levels of nesting produces errors? (not a tables vs CSS question)
3
by: Kaz Kylheku | last post by:
I have a structure of three boxes contained within a box, like this: <div class="line"> <div class="box" id="one">one</div> <div class="box" id="two">two</div> <div class=box"...
14
by: varois83 | last post by:
Hi The code I am pasting below is just practice so the colors are goofy, it's to help me see what is where. The text isn't styled either at this time. I am working on a fixed 2...
1
by: gatorade | last post by:
Drop Down list in a form is breaking layout of the page in FireFox. Here is the page in question: http://www.redchip.com/visibility/RCinstitutional-Requestinfo.asp The layout is simply two...
2
by: joeriatscripts | last post by:
Hey there, Everytime I am trying to create something in CSS, it gives me a headache. This time no different, as FF and IE seem to have their own rules! Anyway, before I continue, have a look at...
2
by: shapper | last post by:
Hello, I created a 2 column layout with header and footer: http://www.27lamps.com/public/layout.htm Am I doing this the right way? One problem I have is when giving padding to my col's...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.