How to make: Box on Boxes

I just mocked this up in a spreadsheet…

What is the best way to make this so I can use it on a responsive website?

(Obviously I want to make this using HTML so search engines can see the text.)

Here are some approaches I can think of…

a.) Use an HTML Table
b.) Use DIVs

I’m not sure how to “layer” the center box over the background boxes. Maybe this isn’t even possible with HTML and CSS?

Here is hoping my creative idea will work on the responsive website I am trying to build… :confused:

P.S. If I can hyperlink the text in each box so it takes the user to a section landing page, that would be awesome! :smile:

For layout? Surely that’s a typo, and you really meant use CSS display: table.

2 Likes

You guys are the experts - I’m just saying what I know…

A tricky one, but I’m sure anything is possible. For 1 to 4 display: table would do it. 5 would have to be placed explicitly over that.
The other challenge is, if the boxes are full of text, getting it to wrap around box 5. In 3 and 4 you could have dummy boxes floated underneath to force the text to wrap, but in 1 and 2, I’m not sure how you would get the floats at the bottom.
Don’t have time right now to think too deeply about it.

When I created this in OO Calc, I drew a box over the spreadsheet - that is I created a second “layer” over the background items.

Can this be done on the web?

It almost seems like I could treat the center box like a floated image…

Can you explain what this is and how it works? The only tables I know are HTML tables. :relaxed:

HTML tables should only be used for tabular data and never for layout. CSS display: table and related properties is a way of emulating the table layout using pure CSS. You can find detailed information by searching either this forum or the Internet.

Using HTML tables for layout went out years ago, with the introduction of CSS.

1 Like

So you are recommending I use a CSS table?

Before recommendations are made, we should be aware of the contents of those boxes and their surroundings (context). Images are easy, text is harder, boxes with content that has a limited minimum width are restricting. Give us more information.

2 Likes

I’m not particularly recommending anything, except that you bring your skills up to date and don’t even consider using HTML for layout.

There are 5 selling points that my new business offers. Concepts 1-4 are maybe 2-3 words (e.g. “Responsive Web Design”) in length. Concept 5 is also a couple words in length.

HTH.

Yes ma’am!

Hi there mikey_w,

check out the attachment to view a possible solution.

little-boxes.zip (1.7 KB)

coothead

1 Like

That’s pretty cool! I will have to look at your code and see if I can figure out what you did.

What is box-img.png

When I open it there is nothing there!

It is a 1px square transparent image, which expands to fit the
available width of it’s container and thereby automatically sets
the height of the container equal to that width.

It is, of course, indiscernible to the naked eye. :sunglasses:

coothead

I’m guessing its just a blank placeholder image, that you can replace with whatever you want.

So if the box was 400px wide then I’d have a 400x400px transparent image times four?

Is that a good idea?

No - you have ONE 1px square image only. You resize it to 400x400 but the image itself remains a single pixel - and the other three can use the SAME image.

But Coothead said…

Exactly. The image is and always will be 1px square.

How much space it takes up on the screen depends on the width and height attributes you apply to the image. This doesn’t change the size of the image itself - only the space it takes up on the screen.

Because the image is transparent you can’t see any distortion when that one pixel is stretched across hundreds of pixels on the screen.