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

Review HTML for ease of use with CSS

I've just written some HTML to be used with CSS and would like some
opinions on if it's any good. I was aiming for the content to be
easily accessible from CSS, bearing in mind the HTML will have
multiple stylesheets applied to it by other people. I want the HTML to
allow the style to be as flexible as possible. It's meant to show
journal entries in a blog style. The code inside the braces is
template engine (Smarty) code and will be processed before serving, I
left it in to make it clearer (I hope!). I'm not too confident on my
choice of divs and spans.

Thanks,
Geoff

HTML:

<div class="journal_entries">
{section name=i loop=$entries}
<div class="journal_entry">
<div class="title">
{$entries[i].title}
</div>
<div class="content">
{$entries[i].processed_content}
</div>
<div class="details">
<div class="posted_by">
Posted by
<span class="name">{$entries[i].name}</span>
</div>
<div class="posted_date">
on
<span class="time_date">{$entries[i].time|date_format:"%H:%M
%A, %B %e, %Y"}</span>
</div>
<div class="posted_location">
Location: <span
class="location">{$entries[i].location}</span>
</div>
</div>
</div>
{/section}
</div>
Jul 20 '05 #1
2 1540
On 16 Jul 2004 07:11:42 -0700, Geoff Soper
<ge***************@alphaworks.co.uk> wrote:
I've just written some HTML to be used with CSS and would like some
opinions on if it's any good. I was aiming for the content to be
easily accessible from CSS, bearing in mind the HTML will have
multiple stylesheets applied to it by other people. I want the HTML to
allow the style to be as flexible as possible. It's meant to show
journal entries in a blog style. The code inside the braces is
template engine (Smarty) code and will be processed before serving, I
left it in to make it clearer (I hope!). I'm not too confident on my
choice of divs and spans.

Thanks,
Geoff
Why not change

<div class="title">{$entries[i].title}</div>

to

<h3>{$entries[i].title}</h3>

? (or whatever level of heading applies within the context of the page)

The selector in the CSS for the above would be

..journal_entries h3 {}

as it's going to be the only h3 within that div, right?
HTML:

<div class="journal_entries">
{section name=i loop=$entries}
<div class="journal_entry">
<div class="title">
{$entries[i].title}
</div>
<div class="content">
{$entries[i].processed_content}
</div>
<div class="details">
<div class="posted_by">
Posted by
<span class="name">{$entries[i].name}</span>
</div>
<div class="posted_date">
on
<span class="time_date">{$entries[i].time|date_format:"%H:%M
%A, %B %e, %Y"}</span>
</div>
<div class="posted_location">
Location: <span
class="location">{$entries[i].location}</span>
</div>
</div>
</div>
{/section}
</div>


Jul 20 '05 #2
ge***************@alphaworks.co.uk (Geoff Soper) writes:
I've just written some HTML to be used with CSS and would like some
opinions on if it's any good. I was aiming for the content to be

HTML:

<div class="title">
{$entries[i].title}
</div>
This should probably be a <hX> element. X is between 2 and 6
inclusive, depending on the page it's been put on.
<div class="content">
{$entries[i].processed_content}
</div>
Presumably processed_content contains <p> markup, etc.
<div class="details">
<div class="posted_by">
Posted by
<span class="name">{$entries[i].name}</span>
</div>
<div class="posted_date">
on
<span class="time_date">{$entries[i].time|date_format:"%H:%M
%A, %B %e, %Y"}</span>
</div>
<div class="posted_location">
Location: <span
class="location">{$entries[i].location}</span>
</div>
</div>


Probably all of posted_by, posted_date and posted_location should be
span, not div. People can set display:block; on them in the
stylesheet, if they want.

--
Chris
Jul 20 '05 #3

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

Similar topics

3
by: Skip Montanaro | last post by:
I help moderate a couple mailing lists on python.org. The biggest challenge for me is vetting messages which were held for review. The information density in the Mailman review page is pretty...
0
by: TechBookReport | last post by:
TechBookReport (http://www.techbookreport.com) has just published a review of the Python Cookbook. This is an extract from the full review: We're big fans of cookbooks here at TechBookReport,...
2
by: Dave Patton | last post by:
I'd appreciate any feedback on http://www.elac.bc.ca/ particularly in regards to how the pages are marked up. The markup is valid HTML 4.01 strict, but that doesn't mean I've done things using...
0
by: TechBookReport | last post by:
There's a review of 'Data Crunching' by Greg Wilson over at TechBookReport. This is not a teach-yourself Python book but one that uses Python to solve various common data-related tasks with regular...
11
by: Guotao Luan | last post by:
Hello All: I notice that there have been frequent questions being asked about template here so I guess it is okay to post this message here. I just wrote a c++ tempalte tutorial/review, I would...
1
by: denasinc | last post by:
Our first real production experience with Source Control came a year ago when we started to cooperate in software development with two other outsourcing companies – one of them is located in...
6
by: Prakash | last post by:
I am using HTML controls in my page i want to Programatically apply CSS for that controls as that of contorol.CSS="cssname" for Web Control. How to do it?. Thanks in Advance Prakash.V
21
by: Johan Tibell | last post by:
I would be grateful if someone had a minute or two to review my hash table implementation. It's not yet commented but hopefully it's short and idiomatic enough to be readable. Some of the code...
263
by: Malcolm McLean | last post by:
The webpages for my new book are now up and running. The book, Basic Algorithms, describes many of the fundamental algorithms used in practical programming, with a bias towards graphics. It...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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.