473,406 Members | 2,217 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,406 software developers and data experts.

Critique, image slicing for fluid CSS layout tutorial

I am halfway through writing a tutorial on image slicing for fluid CSS
layouts, I would love some feedback on what I've done up until this point:

http://nrkn.com/index.html

I am still writing parts 3 & 4, "optimising the layout" and "alpha
transparency".

Also, does anyone know why I don't get numbers or bullets on my ul and ol in
Internet Explorer (6 or 7)?

Thanks!
Nov 8 '07 #1
18 2479
On 7 nov, 23:44, "Nik Coughlin" <nrkn....@gmail.comwrote:
I am halfway through writing a tutorial on image slicing for fluid CSS
layouts, I would love some feedback on what I've done up until this point:

http://nrkn.com/index.html

I am still writing parts 3 & 4, "optimising the layout" and "alpha
transparency".

Also, does anyone know why I don't get numbers or bullets on my ul and olin
Internet Explorer (6 or 7)?

Thanks!
Nik,

Whatever the explanations are for the semi-disappeared (or entirely
disappeared) list markers in Internet Explorer 7, I truly and
completely believe that you should avoid this kind of markup code:

Line 27: <div id="mainT"><div><div></div></div></div>

Line 30: <div id="contentTL"></div>
<div id="contentTR"></div>

Line 34: <div class="hr"><div><div><hr></div></div></div>

Line 81: <div class="hr"><div><div><hr></div></div></div>

Line 89: <div id="mainB"><div><div></div></div></div>

There is such a thing as over-excessively declaring, using and abusing
<divdeclarations: it's called divitis and it is defined at

Developing With Web Standards
Recommendations and best practices
Superfluous elements and classes
http://www.456bereastreet.com/lab/de...dards/css/#css

and at

Web Page Development: Best Practices
Classitis and Divitis
http://developer.apple.com/internet/...estwebdev.html

Remember/keep in mind that the original purpose and goal of using CSS
was to reduce resorting/recourse of bloated markup code: if your CSS
code does not achieve that, then you should examine how you could
reduce the depth and the width of the DOM tree of nodes.

Regards, Gérard

Nov 8 '07 #2
Nik Coughlin wrote:
I believe that this is the minimum amount of markup necessary to achieve
this effect :) Would love to be proven wrong.

Is the effect worth the internal complexity?
Maybe it would be better to just spend more time in the Gimp
perfecting normal images, keeping the page itself simple.

Forcing markup like this:
<div class="hr"><div><div><hr></div></div></div>
is just unsemantic, even though it is technically valid.
Nov 8 '07 #3
On 7 nov, 23:44, "Nik Coughlin" <nrkn....@gmail.comwrote:
I am halfway through writing a tutorial on image slicing for fluid CSS
layouts, I would love some feedback on what I've done up until this point:

http://nrkn.com/index.html

I am still writing parts 3 & 4, "optimising the layout" and "alpha
transparency".

Also, does anyone know why I don't get numbers or bullets on my ul and olin
Internet Explorer (6 or 7)?

Thanks!
Hello again,

You first declared

ol {font-weight: bold;}

in

ol {
color: #5ac90f;
font-weight: bold;
margin: 1em;
}

and ol span {font-weight: normal;}

ol span {
color: #b95207;
font-weight: normal;
}

(Notice here that you re-declare the color for the span instead of
using inheritance. All you had to do is declare color: #b95207 for the
ol element and that was it!)

then used <strongon 3 chunks of text (only 6 words)

and then declared 7 <spanwith font-weight: normal;.

When debugging your code, I removed all that. Everything. And just let
the 3 semantic <strongfor the 3 chunks of text (a grand total of 6
words). I removed 7 non-semantic <span>, removed both font-weight
declarations, remove 1 color declaration and replace the remaing one
with #b95207, then removed the ol span CSS rule.

Your CSS code is definitevly improvable, optimizable.

Also, this universal selector rule
* {
margin: 0;
padding: 0;
}
is a clear sign of over-declaring, over-defining. The use of the
universal selector is very rarely recommendable and is discouraged by
many CSS gurus.
By removing all margin and padding on all elements, you are later
force to add them back almost everywhere (for almost all elements like
p, li, headings, etc) instead of relying on browser default
declarations. I personally never do that and I certainly do not
encourage that practice because it invariably lead to over-declaring,
over-defining.

Finally, regarding your question of disappearing list markers in MSIE
7, you need to increase the margin on the ol to at least 1.5em. I have
created a reduced testcase showing this phenomenon, where the list
markers disappear at around margin: 1.1em. IE has a particular way of
displaying list markers..

Regards and good luck,

Gérard

Nov 8 '07 #4
GTalbot wrote:
On 7 nov, 23:44, "Nik Coughlin" <nrkn....@gmail.comwrote:
>I am halfway through writing a tutorial on image slicing for fluid
CSS layouts, I would love some feedback on what I've done up until
this point:

http://nrkn.com/index.html

Hello again,
Hi!
You first declared

ol {font-weight: bold;}

in

ol {
color: #5ac90f;
font-weight: bold;
margin: 1em;
}

and ol span {font-weight: normal;}
You're right, I'm not quite sure why I did that :)
ol span {
color: #b95207;
font-weight: normal;
}

(Notice here that you re-declare the color for the span instead of
using inheritance. All you had to do is declare color: #b95207 for the
ol element and that was it!)
Actually, the reason for declaring a color for the ol and then wrapping the
li content in a span is so that that the list markers have a different
colour to the list items. There *is* method to the madness! Some would say
that it's not worth having to have the extra markup just to have different
coloured markers, but I think it makes quite a big difference visually, so I
am willing to make that sacrifice.
then used <strongon 3 chunks of text (only 6 words)

and then declared 7 <spanwith font-weight: normal;.
Yeah, the font-weight thing is a cock-up.
When debugging your code, I removed all that. Everything. And just let
the 3 semantic <strongfor the 3 chunks of text (a grand total of 6
words). I removed 7 non-semantic <span>, removed both font-weight
declarations, remove 1 color declaration and replace the remaing one
with #b95207, then removed the ol span CSS rule.

Your CSS code is definitevly improvable, optimizable.
Yep, there are some rules that can be combined that I can see right off the
bat. Anything else off the top of your head that you've noticed is
particularly in need of improvement, or do you just mean combining rules
that are repeated?
Also, this universal selector rule
* {
margin: 0;
padding: 0;
}
is a clear sign of over-declaring, over-defining. The use of the
universal selector is very rarely recommendable and is discouraged by
many CSS gurus.
We will have to agree to disagree on this :) I like this a lot as it
equalizes the way browsers set margins and padding, which are different
between different browsers for different elements.
By removing all margin and padding on all elements, you are later
force to add them back almost everywhere (for almost all elements like
p, li, headings, etc) instead of relying on browser default
declarations.
I find with the layouts that I tend to do it's the opposite, I am always
turning margin and paddings *off* on multiple elements, and with the
universal selector I only end up turning them back on in a few places.
Finally, regarding your question of disappearing list markers in MSIE
7, you need to increase the margin on the ol to at least 1.5em. I have
created a reduced testcase showing this phenomenon, where the list
markers disappear at around margin: 1.1em. IE has a particular way of
displaying list markers..
Excellent, thank you very, very much!
Regards and good luck,
Thanks again. I really appreciate you taking your time to discuss this with
me. It has been a pleasure, even if we disagree on some things!
Nov 8 '07 #5
mbstevens wrote:
Nik Coughlin wrote:
>I believe that this is the minimum amount of markup necessary to
achieve this effect :) Would love to be proven wrong.

Is the effect worth the internal complexity?
Maybe it would be better to just spend more time in the Gimp
perfecting normal images, keeping the page itself simple.
No amount of time spent in the Gimp will help me make an image that
stretches to fit the available width though!
Forcing markup like this:
<div class="hr"><div><div><hr></div></div></div>
is just unsemantic, even though it is technically valid.
Well, for me, sometimes there are trade offs between getting a visual
effect, and being semantically correct. The extra div wrappers are to get
the visual effect (divider that fades away at the edges and resizes to fit
the available width), the <hris there so that there is still a horizontal
rule when CSS isn't present.

Some of these things are just necessary to address the shortcomings of
browser support for HTML/CSS -- almost all of these shortcomings are
addressed in CSS3. If IE/Opera/FF supported multiple background images on a
single element (Safari does) then it wouldn't be necessary.

How I wish it were so!

Thanks for your time :)
Nov 8 '07 #6
In article <13*************@corp.supernews.com>,
mbstevens <NO***********@xmbstevensx.comwrote:
Nik Coughlin wrote:
I believe that this is the minimum amount of markup necessary to achieve
this effect :) Would love to be proven wrong.
Is the effect worth the internal complexity?
Depends on how you count it. It only has to be done once by the
author, and from then on it can give multiple pleasure. On
principle, this may well be worth it.
Forcing markup like this:
<div class="hr"><div><div><hr></div></div></div>
is just unsemantic, even though it is technically valid.
This is yet another issue. But, given that there are limitations
in browser implementations of some css where this sort of thing
can be more easily done in a kosher manner, it is very severe to
never fall to temptation. Perhaps it is an area where a little
individual choice might be allowable.

--
dorayme
Nov 8 '07 #7
dorayme wrote:
In article <13*************@corp.supernews.com>,
mbstevens <NO***********@xmbstevensx.comwrote:
>Nik Coughlin wrote:
>>I believe that this is the minimum amount of markup necessary to
achieve this effect :) Would love to be proven wrong.

Is the effect worth the internal complexity?

Depends on how you count it. It only has to be done once by the
author, and from then on it can give multiple pleasure. On
principle, this may well be worth it.
>Forcing markup like this:
<div class="hr"><div><div><hr></div></div></div>
is just unsemantic, even though it is technically valid.

This is yet another issue. But, given that there are limitations
in browser implementations of some css where this sort of thing
can be more easily done in a kosher manner, it is very severe to
never fall to temptation. Perhaps it is an area where a little
individual choice might be allowable.
I hope so :) I try to only compromise on these things when a visual effect
that I want is otherwise unattainable. Oh, for multi-browser support of
CSS3!
Nov 8 '07 #8
In article <fg**********@aioe.org>,
"Nik Coughlin" <nr******@gmail.comwrote:
dorayme wrote:
In article <13*************@corp.supernews.com>,
mbstevens <NO***********@xmbstevensx.comwrote:
Nik Coughlin wrote:

I believe that this is the minimum amount of markup necessary to
achieve this effect :) Would love to be proven wrong.
Is the effect worth the internal complexity?
Depends on how you count it. It only has to be done once by the
author, and from then on it can give multiple pleasure. On
principle, this may well be worth it.
Forcing markup like this:
<div class="hr"><div><div><hr></div></div></div>
is just unsemantic, even though it is technically valid.
This is yet another issue. But, given that there are limitations
in browser implementations of some css where this sort of thing
can be more easily done in a kosher manner, it is very severe to
never fall to temptation. Perhaps it is an area where a little
individual choice might be allowable.

I hope so :) I try to only compromise on these things when a visual effect
that I want is otherwise unattainable. Oh, for multi-browser support of
CSS3!
Indeed, tell you what though: I would at this moment settle for
multi-browser support of CSS 2.1

:)

--
dorayme
Nov 8 '07 #9
dorayme wrote:
In article <13*************@corp.supernews.com>,
mbstevens <NO***********@xmbstevensx.comwrote:
>Nik Coughlin wrote:
>>I believe that this is the minimum amount of markup necessary to achieve
this effect :) Would love to be proven wrong.

Is the effect worth the internal complexity?

Depends on how you count it. It only has to be done once by the
author, and from then on it can give multiple pleasure. On
principle, this may well be worth it.
I'll have to trust others reports that it gives them pleasure.

Like the often seen attempts at rounded box corners, it looks
mid-90s kitschy to me, but as you say below, individual choice might
be allowable.
>
>Forcing markup like this:
<div class="hr"><div><div><hr></div></div></div>
is just unsemantic, even though it is technically valid.

This is yet another issue. But, given that there are limitations
in browser implementations of some css where this sort of thing
can be more easily done in a kosher manner, it is very severe to
never fall to temptation. Perhaps it is an area where a little
individual choice might be allowable.
Nov 8 '07 #10
Well bust mah britches and call me cheeky, on Thu, 08 Nov 2007 07:07:53
GMT dorayme scribed:
I believe that this is the minimum amount of markup necessary to
achieve this effect :) Would love to be proven wrong.

Is the effect worth the internal complexity?

Depends on how you count it. It only has to be done once by the
author, and from then on it can give multiple pleasure. On
principle, this may well be worth it.
That line never works on dates.
>Forcing markup like this:
<div class="hr"><div><div><hr></div></div></div>
is just unsemantic, even though it is technically valid.

This is yet another issue. But, given that there are limitations
in browser implementations of some css where this sort of thing
can be more easily done in a kosher manner, it is very severe to
never fall to temptation. Perhaps it is an area where a little
individual choice might be allowable.
Despite your rationalization, the least css is the best css. I believe
GTalbot has already resolved the original issue, but Nik is no dummy so the
real problem is the complexity of the styling.

--
Bone Ur
Cavemen have formidable pheromones.
Nov 8 '07 #11
F'ups set to c.i.w.a.s

GTalbot wrote:
>
Also, this universal selector rule
* {
margin: 0;
padding: 0;
}
is a clear sign of over-declaring, over-defining. The use of the
universal selector is very rarely recommendable and is discouraged by
many CSS gurus.
But not all.
By removing all margin and padding on all elements, you are later
force to add them back almost everywhere (for almost all elements like
p, li, headings, etc) instead of relying on browser default
declarations. I personally never do that and I certainly do not
encourage that practice because it invariably lead to over-declaring,
over-defining.
Being later forced to add spacing back to elements is one of the reasons
Eric Meyer *likes* it (see his "Reset Reloaded" article at
<http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/with some
more of the reasoning behind it at
<http://meyerweb.com/eric/thoughts/2007/04/18/reset-reasoning/),
although he does specifically say he doesn't like the * universal
selector, he does do this:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
etc.

While I see his reasoning, I'm not yet persuaded I want to do this for
every page/site I do. But then, I'm not a CSS guru, so maybe my lack of
experience keeps me unenlightened. So like you, Gérard, I never do it
either.

Other discussions of the "reset all" philosophy can be found via an
article called "CSS Frameworks + CSS Reset: Design From Scratch" at
<http://www.smashingmagazine.com/2007/09/21/css-frameworks-css-reset-design-from-scratch/>
, although that page is best visited with CSS (and JS) turned off.
Ironically enough, with CSS enabled, the page takes forever to load and
respond to scrolling. (Disabling JS just keeps the ad count down.)
--
John
Nov 8 '07 #12
On Nov 7, 11:44 pm, "Nik Coughlin" <nrkn....@gmail.comwrote:
I am halfway through writing a tutorial on image slicing for fluid CSS
layouts, I would love some feedback on what I've done up until this point:
http://nrkn.com/index.html
Nice tutorial, I like the layered header idea. Of course you make the
assumption that the header graphic has something on the right and
left, but the middle can be expanded. But when the header can be
handled like that, this is a nice plan.

Nov 8 '07 #13
On 8 Nov, 06:35, mbstevens <NOXwebmast...@xmbstevensx.comwrote:
Forcing markup like this:
<div class="hr"><div><div><hr></div></div></div>
is just unsemantic, even though it is technically valid.
So what? Who says HTML should be entirely semantic.

CSS is _very_ simple and deliberately (read Hakon Lie's PhD thesis)
doesn't include some of the features of other styling langauges.
Amongst these is the ability to do powerful content generation,
sufficient to generate the necessary "hooks" to hang each necesary box
of the rendering model onto. This is particularly evident when
clearing after a sequence of floated boxes.

Some stylesheet languages do support this, but they're more complex
than CSS. CSS gains its simplicity here by requiring the HTML to
already contain a sufficiency of "hook" elements that deliberately
have no smenatic purpose, they're only used (and necessary for)
presentation.

It would be nice to have a purely presentation-free HTML, but not at
the cost of needing to use DSSSL to style it!

Nov 8 '07 #14
On 8 Nov, 05:22, GTalbot <newsgr...@gtalbot.orgwrote:
Web Page Development: Best Practices
Classitis and Divitishttp://developer.apple.com/internet/webcontent/bestwebdev.html
(sobs) 8-(

Nov 8 '07 #15
Travis Newbury wrote:
On Nov 7, 11:44 pm, "Nik Coughlin" <nrkn....@gmail.comwrote:
>I am halfway through writing a tutorial on image slicing for fluid
CSS layouts, I would love some feedback on what I've done up until
this point: http://nrkn.com/index.html

Nice tutorial, I like the layered header idea. Of course you make the
assumption that the header graphic has something on the right and
left, but the middle can be expanded. But when the header can be
handled like that, this is a nice plan.
I would love to expand it to include other scenarios in mind, can you think
of any examples? Thanks!
Nov 8 '07 #16
In article <13*************@corp.supernews.com>,
mbstevens <NO***********@xmbstevensx.comwrote:
dorayme wrote:
In article <13*************@corp.supernews.com>,
mbstevens <NO***********@xmbstevensx.comwrote:
dorayme wrote:
In article <13*************@corp.supernews.com>,
mbstevens <NO***********@xmbstevensx.comwrote:

Nik Coughlin wrote:

I believe that this is the minimum amount of markup necessary to
achieve
this effect :) Would love to be proven wrong.
Is the effect worth the internal complexity?
Depends on how you count it. It only has to be done once by the
author, and from then on it can give multiple pleasure. On
principle, this may well be worth it.
>
I see a kind of smooth scale from pure semantic markup to
clog dancing monkeys. Different people place different points along that
scale where you should just control yourself, or switch over
to Flash or Java Applets. I would resist using the kind of code here
because I would not want to maintain it, and I just find its appearance
unneeded aesthetically. Of course you have to occasionally give in
to clients. (This is also my answer to Andy's reply.)
You have to abstract from particular cases. In plain terms, this
means that you cannot know in advance that it is not worth an
author's time for any site at all. Perhaps we need more examples
of the actual use of code that gets tut tuts from some but which
are plainly nice in effect and hard or impossible to do without.

The fair and substantial complaints are for sites that

(1) Look bloody awful anyway

(2) Work badly in other respects, partly as a result of an
authors over attention to the fancy at the expense of the very
important and unarguable criteria like decent font sizes, screen
flexibility and so on. (Lemme point out that the effect of the
OP's interesting attempts is to at least avoid the often unwanted
fixed nature of images when they are for decoration, this is a
positive for fluid construction).

About maintenance, there are several issues. If an author is in
command of what he has done then it may be very easy for *him* to
maintain it. As for the business of others taking over the site
to maintain it, a sense of perspective is needed. Many of these
fancy things can be commented by the author so the next person
can understand, the commentary might even explain how to dispense
with the fancy parts altogether. Then it is the choice of the new
person (if he has the authority).

--
dorayme
Nov 8 '07 #17
Nik Coughlin wrote:
>
http://nrkn.com/index.html

Also, does anyone know why I don't get numbers or bullets on my ul and ol in
Internet Explorer (6 or 7)?
This might give you a clue:
View Text Size Largest

--
Berg
Nov 8 '07 #18
On 8 Nov, 17:52, mbstevens <NOXwebmast...@xmbstevensx.comwrote:
I would resist using the kind of code here
because I would not want to maintain it, and I just find its appearance
unneeded aesthetically.
What do you mean by "appearance" ? Appearance as finally rendered on
the page, or appearance of the source code, as a rather specialised
aesthetic view by a code guru?

As simple example, you can code "a picture gallery of blocks" as
either a <tableor as floated <div>s. When rendered, the floated
<div>s are considered "better", as they give a more flexible and fluid
rendering. Looking inside the source though, there's a problem in how
to achieve this: it _does_ require more coding. It requires more CSS
and more HTML. In particular, there's a trade-off in how you clear-
down after a sequence of floats. This can be (sometimes) done by
complex and non-robust work in CSS selectors, or more simply and
reliably overall by adding a sprinkling of extra (but justifiable)
HTML elements.

So which do you prefer? I'm not a great fan of additional HTML
elements to clear up after floats, but how else are you going to do
it? De-evolve the design back to a <table>? Use tricksy CSS that
really is hard to understand? Sloppy work with a ragged bottom edge?
Or do it simply, cleanly and correctly, even if it's a little more
verbose? I know which I prefer.

"Divitis" is a hard condition to diagnose, and it's prone to excess
mis-diagnosis. The number of HTML elements should (as a general
principle) be kept to the minimum that are useful, but not reduced any
further!

Nov 9 '07 #19

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

Similar topics

5
by: Alex Bell | last post by:
I have a fluid header/two column layout at http://www.members.iinet.net.au/~abell1/test/demo10.htm which works with windows MSIE 5.5 and 6, Mozilla, Netscape, and Opera; and Safari but which...
49
by: lime | last post by:
I have addressed most of the issues listed in the responses to my last post "Critique CSS layout (1st go - fingers crossed)". I'm rapt with the progress I have made, thanks to all for your past...
22
by: Jam Pa | last post by:
Once again my big mouth has landed me with a tough job. I have a static CSS layout, where each and every element has been defined by pixel size - lots of them, too! Mostly relative elements,...
19
by: TC | last post by:
Are there any good sites or forums for a web critique? I went to alt.html.critique and it's pretty dead.
26
by: JB | last post by:
Hi All, This is my first go at a pure CSS web site and I'd like your comments and suggestions please. The URL is http://www.waukeshapumps.com/ Comments on CSS, design and content very...
12
by: JB | last post by:
Hi All, Is it acceptable to use a fixed width vertical navigation column within a fluid 2 or 3 column layout? Example. Left Column (navigation) fixed width of say 180px Right Column (main...
6
by: Seth Illgard | last post by:
Hi, Im writting a custom CMS and everything looks great, except when I see the results in IE. What im trying to do is: *Have an image in a layer (or relative positioned, or just margined). The...
3
by: akapsycho | last post by:
I'm not sure if this is possible, but I thought that my best shot would be to ask here. My site's coming along well at http://www.antiriddle.com and I'm trying to improve on the current design....
1
by: Nik Coughlin | last post by:
For anyone who's interested, or if you'd like to offer any suggestions or critiques of the finished tutorial: http://nrkn.com/index.html
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.