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

brick style boxis css problem

hi!

I'm newbie in css and I can't make myself brick boxes that work in IE and Firefox.
The problem is in brick size and layout. Can anybody put there code, how to make such wall without absolute positioning? Boxes should be with borders and with widths (different for each but pointed with width parameter). Height of boxes are equal. In one row is ~ 20-30 boxes with different widths. There is no vertical space between boxes.

________________
| x | xxxxx | x | ....
______________________________
| x | x | x | xxxxxxxxxxx | xxxxxxx | ....
______________________________
| x | x | x | xxxx | xxxxx | ....
_____________________
....

Norm
Nov 22 '06 #1
6 2567
Hello,

Could you clarify what you mean by "bricks"?

Is this a background, or will content be placed in the boxes?

Is the "wall" to be fluid, and resize with the window?
Nov 22 '06 #2
Ok. This is a brick wall. Try it out. Let me know if this is what you wanted.

Here is the HTML with the CSS inside it:

[HTML]<html>
<head>

<style type="text/css">

<!--

.brick-narrow, .brick-medium, .brick-wide {
height: 50px;
border: 2px solid #ccc;
background-color: red;
float: left;
}

.brick-narrow {
width: 100px;
}

.brick-medium {
width: 150px;
}

.brick-wide {
width: 200px;
}

.row {}

-->

</style>

</head>

<body>

<div class="row">

<div class="brick-narrow">Brick</div>
<div class="brick-narrow">Brick</div>
<div class="brick-medium">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-narrow">Brick</div>

<div>


<div class="row">

<div class="brick-wide">Brick</div>
<div class="brick-medium">Brick</div>
<div class="brick-medium">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-narrow">Brick</div>
<div class="brick-medium">Brick</div>

<div>

<div class="row">

<div class="brick-narrow">Brick</div>
<div class="brick-narrow">Brick</div>
<div class="brick-medium">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-narrow">Brick</div>

<div>

</body>

</html>[/HTML]

Note: the <div class="row"> are simply for orginization -- they provide no structure. Also, this brick wall was tested in Firefox, Opera, and Safari for Mac. I don't know what it will do in Internet Explorer.
Nov 23 '06 #3
thanks bradvanwick,

this is right direction, but still there are 2 problems

1) if I'm increasing border, on IE the wall looks smaller than on Firefox
2) if brick is first brick in 2nd row, it always should be first brick in 2nd row. there should be no wrapping and I should be able to point, which brick is first in the row.

2nd problem is more important

Norm

Ok. This is a brick wall. Try it out. Let me know if this is what you wanted.

Here is the HTML with the CSS inside it:

[HTML]<html>
<head>

<style type="text/css">

<!--

.brick-narrow, .brick-medium, .brick-wide {
height: 50px;
border: 2px solid #ccc;
background-color: red;
float: left;
}

.brick-narrow {
width: 100px;
}

.brick-medium {
width: 150px;
}

.brick-wide {
width: 200px;
}

.row {}

-->

</style>

</head>

<body>

<div class="row">

<div class="brick-narrow">Brick</div>
<div class="brick-narrow">Brick</div>
<div class="brick-medium">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-narrow">Brick</div>

<div>


<div class="row">

<div class="brick-wide">Brick</div>
<div class="brick-medium">Brick</div>
<div class="brick-medium">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-narrow">Brick</div>
<div class="brick-medium">Brick</div>

<div>

<div class="row">

<div class="brick-narrow">Brick</div>
<div class="brick-narrow">Brick</div>
<div class="brick-medium">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-wide">Brick</div>
<div class="brick-narrow">Brick</div>

<div>

</body>

</html>[/HTML]

Note: the <div class="row"> are simply for orginization -- they provide no structure. Also, this brick wall was tested in Firefox, Opera, and Safari for Mac. I don't know what it will do in Internet Explorer.
Nov 23 '06 #4
drhowarddrfine
7,435 Expert 4TB
First, there are errors in that code. Validate it.
Second, you will never get IE to pretend to act like a modern browser without a proper doctype. Use this one:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Nov 23 '06 #5
AricC
1,892 Expert 1GB
I think you'll get the effect you want if you use an image.
Nov 23 '06 #6
Both drhowarddrfine and AricC are correct. IE will not act properly.

To drhowarddrfine: I didn't give the DOCTYPE declaration in that snippet for simplicity's sake. I agree with you that validation generally corrects most problems (accept not in IE of course).

To normunds: Like AricC wrote, images may be a better way. Also, you may find it difficult to acheive a layout that does not wrap if you don't use some kind of absolute positioning.
Nov 23 '06 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Shaun | last post by:
Hi, I have a table of Locations around the country. My system produces reports based on these Locations. I also have a table containing Brick Codes e.g. Brick Post Code AB51 AB51 AB52 ...
13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
13
by: TheKeith | last post by:
Is it just me or does opera and ie not render the float style properly? IE does a sucky job at it, but opera makes a total mess; Mozilla/Firefox renders it correctly however. I'm just trying to be...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
108
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would...
10
by: Gary Jones | last post by:
Hi, I'm trying to find my feet with C# and have hit a bit of a wall. I have lots of legacy code in a DLL written in Delphi. I don't think the fact that it's written in Delphi should cause too...
3
by: Joe Cox | last post by:
I am having a problem with style properties for dynamic images in Mac OS X Safari. By dymanic images, I mean images allocated with the javascript 'new Image()' call. With static images (created...
4
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.