Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > HTML, XML, Javascript, AJAX
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 08-05-2002, 02:58 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
<p> </p>

is there any way to use a <p> tag without making such a big space between 2 different tags?

i just want to use styles sheets to format text in 2 different colors and sizes, .. but i do not want there to be a big vertical space between the <p></p> and <p> </p> tags.

it seems like i'm getting the equivilent to <br><br> between 2 <p> tags.

can i fix this?
__________________
sde is offline   Reply With Quote
Old 08-05-2002, 04:28 PM   #2 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
<p> = paragraph tags, the point is to have the space

probably the tag you want is <span> </span>
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-05-2002, 04:44 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
thanks again, funny how i can program support centers, online learning systems and web communities, yet i still get hung up on style sheets. i think this is why i'm forcing myself to use them now.

i do appreciate it abc.
__________________
sde is offline   Reply With Quote
Old 08-11-2002, 03:04 PM   #4 (permalink)
OMFG_dude_WTF
Registered User
 
OMFG_dude_WTF's Avatar
 
Join Date: Aug 2002
Posts: 0
OMFG_dude_WTF is on a distinguished road
I was having that same problem....I was wanting to make it easier to format text using CSS like:
<p class="whatever"></p> then change the text in mid paragraph...but you have to </p> and start a new <p class="different"> and you get those friggin spaces.

Haven't tried <span>...I will have to keep that in mind.
__________________
OMFG_dude_WTF is offline   Reply With Quote
Old 08-11-2002, 08:51 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
i'm using span all over the place now, i love span! =)
__________________
sde is offline   Reply With Quote
Old 08-12-2002, 07:35 PM   #6 (permalink)
Mytch
Registered User
 
Join Date: Aug 2002
Posts: 2
Mytch is on a distinguished road
One of the best tricks that I like to use is create a 1x1 transparent image and just set its height to change the space between things, instead of using <p> or <br>, like this:

<br><img sc="blank.gif" width="1" height="10"><br>

Works well on graphic-intense sites where spacing is critical.
__________________
Mytch is offline   Reply With Quote
Old 08-12-2002, 08:37 PM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
aah.. spacer.gif width=1 height=1 owns all

i usually keep the spacer at a 1x1 size and just apply the size to the table i have it embeded in.

<table border=0 cellspacing=0 height=0>
<tr>
<td height=1 width=100% bgcolor=#00000><img src=spacer.gif height=1 width=1></td>
</tr>
</table>

kinda like that.


great point!
__________________
sde is offline   Reply With Quote
Old 08-12-2002, 11:59 PM   #8 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
aren't you guys forgetting about css?

how about:
<p style="padding-top: 10px">&nbsp;</p>

mm? or isn't that what you want..
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-13-2002, 01:11 AM   #9 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
i use tables a lot to frame out my sites .. a lot of times i need a 1 pixel row with a different background color .. that is when i use the 1pixel spacer.. if you don't put anything in the table, some browsers won't detect the row.
__________________
sde is offline   Reply With Quote
Old 08-13-2002, 01:20 AM   #10 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
yer, i actually put a "andbnsp;" in between there but it got converted

if u use that it has the same effect and doesn't use a picture..
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-13-2002, 01:47 AM   #11 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
hehe, you should try that =)

&nbsp; is a space, but it also is a space the height of character. you can not get a 1 pixel high cell if you use &nbsp;

that is why spacer.gif owns!
__________________
sde is offline   Reply With Quote
Old 08-13-2002, 02:00 AM   #12 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
<p style="height: 1px"> ... </p> ... ?
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-13-2002, 05:55 AM   #13 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
oh , i thought you meant w/o the <p>

so i suppose then the only advantages for using an image is assuring the field where the image resides will not be resized horizontally as the user's screen size varies. ( when using an image with a bigger width attribute. <img src=height=1 width=200> )
__________________
sde is offline   Reply With Quote
Old 08-14-2002, 09:36 PM   #14 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
upon seeing the "spacer.gif" all over the place in your source here i decided to revisit this topic

<span style="height: 1px;font-size: 1px; width:200px;">[space]</span> should do the same thing right?

MAYBE even <img src=null etc />
but i haven't tested that, and it probably wont work

anyhow..........................................
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-14-2002, 09:43 PM   #15 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
<img src=images/spacer.gif height=1 width=1>

is less code than

<span style="height: 1px;font-size: 1px; width:200px;">[space]</span>

and i can just use my tables to do the sizing and coloring for me. i guess that is what it comes down to. since my entire site uses tables, i might as well use them for sizing.
__________________
sde is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 06:52 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle