473,806 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Glueing" grapchic with inline text together?

Hello,

Let's say I have the following code:

<img src="/path/to/little/decorative/graphic"><a href="/link/path">Link</a>

When I now make my browser window smaller eventually the graphic and the
link text will break into two lines. I don't want that to happen. How to
I accomplish that? I tried putting a non-breaking space between the
image and the link, but perhaps I'm misunderstandin g the concept of
&nbsp; since that doesn't solve anything.

Kind regards
TomB
Nov 4 '05 #1
14 2976
In post <news:e2******* *************** ****@news.versa tel.nl>,
TomB said:
<img src="/path/to/little/decorative/graphic"><a href="/link/path">Link</a>

When I now make my browser window smaller eventually the graphic and the
link text will break into two lines. I don't want that to happen.


white-space:nowrap; on the element containing the image and the link.

--
l i t t l e v o i c e s
Nov 4 '05 #2
brucie wrote:
In post <news:e2******* *************** ****@news.versa tel.nl>,
TomB said:

<img src="/path/to/little/decorative/graphic"><a href="/link/path">Link</a>

When I now make my browser window smaller eventually the graphic and the
link text will break into two lines. I don't want that to happen.

white-space:nowrap; on the element containing the image and the link.


Great. Thanks!!!
Nov 4 '05 #3
TomB <dr******@dus k-metal.kicks-ass.org> wrote:
Let's say I have the following code:

<img src="/path/to/little/decorative/graphic"><a href="/link/path">Link</a>

When I now make my browser window smaller eventually the graphic and the
link text will break into two lines.
Preventing the break will result in a horizontal scrollbar, this should
be avoided when possible.
I don't want that to happen.


Stop wanting that.

Btw, this is not an HTML but a style issue (CSS is on topic in alt.html
or comp.infosystem s.www.authoring.stylesheets).

--
Spartanicus
Nov 4 '05 #4
Spartanicus wrote:
TomB <dr******@dus k-metal.kicks-ass.org> wrote:

Let's say I have the following code:

<img src="/path/to/little/decorative/graphic"><a href="/link/path">Link</a>

When I now make my browser window smaller eventually the graphic and the
link text will break into two lines.

Preventing the break will result in a horizontal scrollbar, this should
be avoided when possible.


I'm aware of that. However, the graphic is only 14px in width so in this
case it isn't a big deal.
I don't want that to happen.

Stop wanting that.


I won't.
Btw, this is not an HTML but a style issue (CSS is on topic in alt.html
or comp.infosystem s.www.authoring.stylesheets).


That's true. Sorry for that. I still keep looking for style solutions
html wise. My bad.

Greets
TomB

Nov 4 '05 #5
TomB <dr******@dus k-metal.kicks-ass.org> wrote:
Preventing the break will result in a horizontal scrollbar, this should
be avoided when possible.


I'm aware of that. However, the graphic is only 14px in width so in this
case it isn't a big deal.


What matters is the combined width of the graphic and the text. If there
is little text then there is no need to be worried about it wrapping in
small viewport widths, if there is more than a little text then the
horizontal scrollbar will appear long before it is necessary.

Since you have not told us what it is you are actually trying to do it
is hard to give proper advice, but coding a decorative graphic as
content (i.e. in the HTML) is questionable.

--
Spartanicus
Nov 4 '05 #6
Spartanicus wrote:
TomB <dr******@dus k-metal.kicks-ass.org> wrote:

Preventing the break will result in a horizontal scrollbar, this should
be avoided when possible.


I'm aware of that. However, the graphic is only 14px in width so in this
case it isn't a big deal.

What matters is the combined width of the graphic and the text. If there
is little text then there is no need to be worried about it wrapping in
small viewport widths, if there is more than a little text then the
horizontal scrollbar will appear long before it is necessary.

Since you have not told us what it is you are actually trying to do it
is hard to give proper advice, but coding a decorative graphic as
content (i.e. in the HTML) is questionable.


I completely second what you are saying. To clarify, my particular case
is the following:

Wide viewport:
img linktext img linktext img linktext img linktext

Narrow viewport:
img linktext
img linktext
img linktext
img linktext

rather than
img
linktext
img
linktext
etc...

;-)
Nov 4 '05 #7
TomB <dr******@dus k-metal.kicks-ass.org> wrote:
Let's say I have the following code:

<img src="/path/to/little/decorative/graphic"><a href="/link/path">Link</a>


Then first fix it. It's invalid markup.

Before the fix, you could first consider whether you actually have a list of
links, so that the images act as list bullets. Then the logical approach is
to remove the <img> elements, change the list to use <ul> markup, and
consider writing some CSS styling, including list-style-image.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Nov 4 '05 #8
Jukka K. Korpela wrote:
TomB <dr******@dus k-metal.kicks-ass.org> wrote:

Let's say I have the following code:

<img src="/path/to/little/decorative/graphic"><a href="/link/path">Link</a>

Then first fix it. It's invalid markup.


Oops. Got me there.
Before the fix, you could first consider whether you actually have a list of
links, so that the images act as list bullets. Then the logical approach is
to remove the <img> elements, change the list to use <ul> markup, and
consider writing some CSS styling, including list-style-image.


So it's possible to define your own bullets? Besides that, isn't a list
always displayed vertically? I need them displayed horizontally, unless
the viewport becomes to small.

Here's the actual code:

..navbox { display: block; text-align: center; margin-left: auto;
margin-right: auto; }
<div class="navbox">
<p>
<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="news.php" >News</a></span>
<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="bio.php"> Biography</a></span>
<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="media.php ">Media</a></span>

<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="shows.php ">Shows</a></span>
<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="band.php" >Band</a></span>
</p>
<p>
<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="releases. php">Releases</a></span>
<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="contact.p hp">Contact</a></span>
<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="http://dusk-forum.heavymeta l.be"
target="_blank" >Forum</a></span>

<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="gbook.php ">Guestbook </a></span>
<span class="glue"><i mg src="img/icon_mini.gif" width="12"
height="13" alt="">&nbsp;<a href="links.php ">Links</a></span>
</p>
</div>

Greets,
TomB

Nov 4 '05 #9
TomB wrote:

So it's possible to define your own bullets? Besides that, isn't a list
always displayed vertically? I need them displayed horizontally, unless
the viewport becomes to small.

Visit <http://css.maxdesign.c om.au/listamatic/>

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Nov 4 '05 #10

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

Similar topics

5
1738
by: Peter Clark | last post by:
Think of something like MyYahoo: a personalized portal with news aggregator, weather forecast, comics, etc. Now instead of visiting a web site, think of all of it being sent daily as an email. It does have a web interface, but mostly for selecting your content: this is my location for weather, these are the news feeds I'm interested in, these are the comics I like, save my preferences, and the server takes care of the rest. Does such a...
0
9719
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
9598
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
10623
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
10371
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...
0
10111
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
9192
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
5546
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
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
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

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.