473,686 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

headers and <br>s

Earlier, there was a discussion of why not to use <br>s too much. I
mostly don't like using <br>s at all but there is one situation where
its seems better than the alternative.

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class='no_botto m_margin'> this is the paragraph header</h4>
<p class='no_top_m argin'> this is the paragraph</p>

But this is sometimes more obnoxious than

<p>
<span class='paragrap hheader'>this is the paragraph header</span>
<br>
this is the paragraph</p>

How would you do this ?
Nov 11 '05 #1
13 1800
meltedown wrote:

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class='no_botto m_margin'> this is the paragraph header</h4>
<p class='no_top_m argin'> this is the paragraph</p>

But this is sometimes more obnoxious than
"Obnoxious? " Why?
<p>
<span class='paragrap hheader'>this is the paragraph header</span>
<br>
this is the paragraph</p>

This removes useful markup from your content. The header becomes just a
modified form of body text and less for non-visual browsers to process.
And changing header styles does not affect that text style increasing your
maintenance burden.
Do you use the gapless presentation randomly? Or does it tend to clump
together?
Hey! You could use a division and cascade the h4 and p elements so no
explicit class attribute is required.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Nov 11 '05 #2
Once upon a time *meltedown* wrote:
Earlier, there was a discussion of why not to use <br>s too much. I
mostly don't like using <br>s at all but there is one situation where
its seems better than the alternative.

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class='no_botto m_margin'> this is the paragraph header</h4>
<p class='no_top_m argin'> this is the paragraph</p>

But this is sometimes more obnoxious than

<p>
<span class='paragrap hheader'>this is the paragraph header</span>
<br>
this is the paragraph</p>

How would you do this ?


If that header and paragraph is an exeption, different from other
paragraps and <h4> headers on the site, then I use just <h4
style="blablabl a"> and <p style="blabla">

But I always try to give all header tags their own style, in the
stylesheet file, e.g. h1 {margin-bottom:12px;} and so on. Less margin
for smaller (sub)headers and use them the same way all over the site.

For the paragraph tag, I mostly set top-margin to "0px" and only use a
bottom-margin to make a space before the next paragraph. That way I
can have a header and a following paragraph with the margins I like.

--
/Arne
-- *Joke of the day* ----------------------------------------
Tech Support: What anti-virus program do you use?
Customer: Netscape.
Tech Support: That's not an anti-virus program.
Customer: Oh, sorry...Interne t Explorer.
-------------------------------------------------------------
Nov 11 '05 #3
Jim Moe wrote:
meltedown wrote:

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class='no_botto m_margin'> this is the paragraph header</h4>
<p class='no_top_m argin'> this is the paragraph</p>

But this is sometimes more obnoxious than
"Obnoxious? " Why?


Just that adding all those classes to the tags is a chore. I'll do it
rather than using <br>'s (it seems like I'm giving up control of my text
when anything is not in a block element). I just thought there might be
a shortcut I hadn't thought of.

<p>
<span class='paragrap hheader'>this is the paragraph header</span>
<br>
this is the paragraph</p>

This removes useful markup from your content. The header becomes just
a modified form of body text and less for non-visual browsers to
process. And changing header styles does not affect that text style
increasing your maintenance burden.
Do you use the gapless presentation randomly? Or does it tend to clump
together?
Hey! You could use a division and cascade the h4 and p elements so no
explicit class attribute is required.


I guess that could work if all the paragraphs were that way, but there
are always more paragraphs below the one next to the header. All the
header are the same so it would at least cut down on the need to cite
header classes.
Nov 11 '05 #4
Arne wrote:
Once upon a time *meltedown* wrote:

Earlier, there was a discussion of why not to use <br>s too much. I
mostly don't like using <br>s at all but there is one situation where
its seems better than the alternative.

<h4> this is the paragraph header</h4>
<p> this is the paragraph</p>

If I want no margin between the header and the paragraph, I can use:
<h4 class='no_botto m_margin'> this is the paragraph header</h4>
<p class='no_top_m argin'> this is the paragraph</p>

But this is sometimes more obnoxious than

<p>
<span class='paragrap hheader'>this is the paragraph header</span>
<br>
this is the paragraph</p>

How would you do this ?

If that header and paragraph is an exeption, different from other
paragraps and <h4> headers on the site, then I use just <h4
style="blablabl a"> and <p style="blabla">

But I always try to give all header tags their own style, in the
stylesheet file, e.g. h1 {margin-bottom:12px;} and so on. Less margin
for smaller (sub)headers and use them the same way all over the site.

For the paragraph tag, I mostly set top-margin to "0px" and only use a
bottom-margin to make a space before the next paragraph. That way I
can have a header and a following paragraph with the margins I like.

That's a good tip, that might be the shortcut I'm looking for. Thanks.
Nov 11 '05 #5
meltedown wrote:
Jim Moe wrote:
meltedown wrote:
<h4 class='no_botto m_margin'> this is the paragraph header</h4>
<p class='no_top_m argin'> this is the paragraph</p>


there
are always more paragraphs below the one next to the header.


Class selectors aren't required. I think someone else already suggested
this:

h4 {margin-bottom: 0;}
p {margin-top: 0; margin-bottom: 1em;}

I do this all the time, on ol/ul as well as paragraphs. Works very nicely.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Nov 23 '05 #6
kchayka wrote:
meltedown wrote:
Jim Moe wrote:
meltedown wrote:
<h4 class='no_botto m_margin'> this is the paragraph header</h4>
<p class='no_top_m argin'> this is the paragraph</p>


there
are always more paragraphs below the one next to the header.

Class selectors aren't required. I think someone else already suggested
this:

h4 {margin-bottom: 0;}
p {margin-top: 0; margin-bottom: 1em;}

I do this all the time, on ol/ul as well as paragraphs. Works very nicely.

OK thanks, I think I got the hang of it. I used to know this too.
Nov 23 '05 #7
meltedown wrote:
Do you use the gapless presentation randomly? Or does it tend to
clump together?
Hey! You could use a division and cascade the h4 and p elements so
no explicit class attribute is required.


I guess that could work if all the paragraphs were that way, but there
are always more paragraphs below the one next to the header. All the
header are the same so it would at least cut down on the need to cite
header classes.

Sometimes you want space, sometimes you don't. I was curious how the
space/no-space decision occurs: for a whole page? a small section of a
page? Alternate sections? Randomly picked by source code? (Okay, the last
one is unlikely. :-))

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Nov 23 '05 #8
Jim Moe wrote:
meltedown wrote:
Do you use the gapless presentation randomly? Or does it tend to
clump together?
Hey! You could use a division and cascade the h4 and p elements so
no explicit class attribute is required.

I guess that could work if all the paragraphs were that way, but there
are always more paragraphs below the one next to the header. All the
header are the same so it would at least cut down on the need to cite
header classes.

>

Sometimes you want space, sometimes you don't. I was curious how the
space/no-space decision occurs: for a whole page? a small section of a
page? Alternate sections? Randomly picked by source code? (Okay, the
last one is unlikely. :-))

I want a space between everything but a header and a paragraph.
The stuff kchayka and Arne suggested is fine.
h4 {margin-bottom: 0;}
p {margin-top: 0; margin-bottom: 1em;}

Nov 23 '05 #9
On Sat, 12 Nov 2005, meltedown wrote:
I want a space between everything but a header and a paragraph.
The stuff kchayka and Arne suggested is fine.
h4 {margin-bottom: 0;}
p {margin-top: 0; margin-bottom: 1em;}


Have you seen
http://www.complexspiral.com/publica...psing-margins/ ?

Might help in understanding the available options.

Nov 23 '05 #10

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

Similar topics

4
7862
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my "languages" files and these are describes for things on my website. Example text looks like this:
6
12153
by: Lasse | last post by:
I have done this simple function, it seems to work as intended, to solve a problem i have had for a while. I couldnt find any sample around that was working for me. I would like to test it with you and see if there are any improvments that i should make ;-) It should be fast and if possible compatible with todays modern browser-standards. It should be activated by the onload-event. This is my code, free for all to use:
7
19127
by: noor.rahman | last post by:
I have an XML file that stores data from an HTML form. I use XSL to display the data in HTML format. The data may have newline characters. However, XSL is not displaying the newlines properly in the browser. I even replaced all the newlines with <BR/> tags but eventhough I see the tags in my source, I don't get a line break in the output document. Any help would be greatly appreciated.
7
2741
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no tags will remain making the page safe (I have to convert the linefeeds to <BR>s because the Server.EncodeHTML does not do that it seems). The problem is that users can use a special tag when editing the top to specify an area of the tip that will...
2
2530
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all the charcontrols option and chr(13) with success.. was using the following code: Dim s As String = MyTextbox.Text
1
3170
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all the charcontrols option and chr(13) with success.. was using the following code: Dim s As String = MyTextbox.Text
9
43148
by: Wayne | last post by:
$a = $_POST; # txt_content = This is a<CR><LF>Test $p = str_replace ("%0D%0A", "<br>", $a); That is the above code that I am using, however, it is not picking up the CR/LF from the textarea. I have also attempted singular variations of the CR/LF combination and even reversed the sequence without success. Is it possible that it may be encoded differently and if so what is it? Thanks
2
19572
by: xhe | last post by:
I met a very headache problem in javascript, I think this might be difference between IE and NS / Safari. I have a text area <form> <textarea name='tex1' onkeyup='displayit();'></textarea> </form> <span id="txtValue"></span> <script language='javascript'>
7
3620
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what most people use when they write static code (some people use <br>, but with xhtml you are required to close all tags), IE6 simply breaks to the next line like it is supposed to. However, with <br></br>, which is what is sometimes generated by...
0
8523
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
8942
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8776
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7610
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...
0
5802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4537
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2957
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
2210
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.