473,813 Members | 3,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_cont ent}
</div>
<div class="details" >
<div class="posted_b y">
Posted by
<span class="name">{$ entries[i].name}</span>
</div>
<div class="posted_d ate">
on
<span class="time_dat e">{$entries[i].time|date_form at:"%H:%M
%A, %B %e, %Y"}</span>
</div>
<div class="posted_l ocation">
Location: <span
class="location ">{$entries[i].location}</span>
</div>
</div>
</div>
{/section}
</div>
Jul 20 '05 #1
2 1565
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_entri es 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_cont ent}
</div>
<div class="details" >
<div class="posted_b y">
Posted by
<span class="name">{$ entries[i].name}</span>
</div>
<div class="posted_d ate">
on
<span class="time_dat e">{$entries[i].time|date_form at:"%H:%M
%A, %B %e, %Y"}</span>
</div>
<div class="posted_l ocation">
Location: <span
class="location ">{$entries[i].location}</span>
</div>
</div>
</div>
{/section}
</div>


Jul 20 '05 #2
ge************* **@alphaworks.c o.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_cont ent}
</div>
Presumably processed_conte nt contains <p> markup, etc.
<div class="details" >
<div class="posted_b y">
Posted by
<span class="name">{$ entries[i].name}</span>
</div>
<div class="posted_d ate">
on
<span class="time_dat e">{$entries[i].time|date_form at:"%H:%M
%A, %B %e, %Y"}</span>
</div>
<div class="posted_l ocation">
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
1510
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 low, typically showing only two or three messages per screen. Most of the time all I'm really interested in are the subject and the disposition buttons. I wrote a script to display just that information (and set the default disposition to...
0
1226
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, whether its Java, XSLT or Linux, they're a great way of pulling together lots of useful snippets of code and technique in one place. For the beginner they provide instant advice, usable code and a way into new areas. They're also a great way to find...
2
662
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 'best practices'. The goal was to rewrite a site that previously had used frames, had some broken links, and was authored with frontpage. I had to use the existing content, and the goal wasn't to "redesign", but to "rewrite".
0
1009
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 expressions, XML, SQL and so on. The review is here: http://www.techbookreport.com/tbr0172.html -- TechBookReport - Programming http://www.techbookreport.com/ProgIndex.html
11
3220
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 like to hear feedbacks from other users. I do not have much experience with template myself so I am sure there are many problems or even mistakes in this material. Comments of all types are welcomed. and I also hope this tutorial/review is helpful...
1
1519
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 Europe. Since Visual SourceSafe and similar tools at the time could be used only in the intranet environment, we started with task assignment and sharing files through e-mails, trying to organize distributed development and keep synchronization of...
6
1744
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
3233
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 (i.e. the get_hash function) is borrowed from various snippets I found on the net. Thee free function could probably need some love. I have been thinking about having a second linked list of all entries so that the cost of freeing is in proportion to...
263
9420
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 includes mathematical routines from the basics up, including floating point arithmetic, compression techniques, including the GIF and JPEG file formats, hashing, red black trees, 3D and 3D graphics, colour spaces, machine learning with neural...
0
9734
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10664
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10139
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9220
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7678
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.