473,470 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Auto remove whitespace from HTML

Consider an example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style>
a { background-color:red;}
</style>
</head>
<body>

<a href="#">A</a>
<a href="#">B</a>
<a href="#">C</a>
<a href="#">D</a>
<a href="#">E</a>
<a href="#">F</a>
<a href="#">G</a>

</body>
</html>
There are whitespace within each hyperlink, without touching the
source, is it possible to remove all the whitespaces?

Thanks.
Jun 27 '08 #1
4 4318
In article
<de**********************************@1g2000prf.go oglegroups.com>,
howa <ho******@gmail.comwrote:
Consider an example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style>
a { background-color:red;}
</style>
</head>
<body>

<a href="#">A</a>
<a href="#">B</a>
<a href="#">C</a>
<a href="#">D</a>
<a href="#">E</a>
<a href="#">F</a>
<a href="#">G</a>

</body>
</html>
There are whitespace within each hyperlink, without touching the
source, is it possible to remove all the whitespaces?

Thanks.
Fixing up a few things in your mark up, closest is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>A howa question</title>
<style type="text/css" media="all">
a { background-color:red;}
</style>
</head>
<body>
<div>
<a href="#">A</a
><a href="#">B</a
<a href="#">C</a
<a href="#">D</a
<a href="#">E</a
<a href="#">F</a
<a href="#">G</a>
</div>
</body>
</html>

--
dorayme
Jun 27 '08 #2
In article
<do**********************************@news-vip.optusnet.com.au>,
dorayme <do************@optusnet.com.auwrote:
In article
<de**********************************@1g2000prf.go oglegroups.com>,
howa <ho******@gmail.comwrote:
Fixing up a few things in your mark up, closest is:
Or perhaps I should have:

<http://dorayme.890m.com/alt/howa589.html>

--
dorayme
Jun 27 '08 #3
On 4$B7n(B14$BF|(B, $B2<8a(B3$B;~(B07$BJ,(B, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<doraymeRidThis-02AA15.17010114042...@news-vip.optusnet.com.au>,

dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<de09cfa9-0684-4627-b986-8ec4cedd6...@1g2000prf.googlegroups.com>,
howa <howac...@gmail.comwrote:
Fixing up a few things in your mark up, closest is:

Or perhaps I should have:

<http://dorayme.890m.com/alt/howa589.html>

--
dorayme

Thanks.
Jun 27 '08 #4
howa wrote:
>
<a href="#">A</a>
<a href="#">B</a>

There are whitespace within each hyperlink, without touching the
source, is it possible to remove all the whitespaces?
a {float:left}

BTW, next time post a URL, not code.

--
Berg
Jun 27 '08 #5

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

Similar topics

9
by: Thomas Mlynarczyk | last post by:
Which is the simplest way to remove all whitespace from a string? Is there a simpler method than a regex replace? Or how can I tell a regex pattern to ignore all whitespace in my subject string?...
1
by: Glabbeek | last post by:
I'm changing the layout of my site. Instead of using tables, I will use DIVs. It's working fine, except for 1 thing: In IE6 some DIVs are not the correct width. Mozilla and Opera are showing the...
0
by: Jeje | last post by:
Hi everybody, I have an issue using the scrollbar under Internet explorer 6, WinXP and transitional.dtd. Here's my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
3
by: Aaron | last post by:
is there a way to remove all white spaces in the html output? ie. everything as one line.
5
by: Donald Canton | last post by:
What's the best way to remove trailing whitespace from a string? For example: "John C. Doe \t" would become "John C. Doe". Thanks.
12
by: Oberon | last post by:
I have a large HTML document. It has hundreds of <span>s which have no attributes so these <span>s are redundant. How can I remove these tags automatically? The document also has <span>s with...
5
by: Psych971 | last post by:
Hi, I'm wondering how I can generate a postback using javascript on a page that does not have any controls with the auto-postback property set to true. I know I can just use the submit() function...
15
by: morleyc | last post by:
Hi, i would like to remove a number of characters from my string (\t \r \n which are throughout the string), i know regex can do this but i have no idea how. Any pointers much appreciated. Chris
1
by: neridaj | last post by:
Hello, I've found a few postings of this problem but none of the answers seem to fix my problem. I have a content div wrapped around a left floated image and a right floated table. I want the...
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
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,...
0
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...
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
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...
1
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
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...

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.