Member Avatar for LastMitch

Hi

I'm starting to learn html/css. I have a issue of breaking a caption in the alt into 2 lines.

This is my image example

<img src="images/Tom3.jpg" width="400" height="400" alt="Image is ... yada .. whatever" />

I want the caption in the alt stop at width 400 of the image and go back to the front width 1

I hope that make sense. I try to used <br> but it didn't work. Any suggestions?

alt is for displaying a text when the image isn't loaded. It is not meant to be a hint. If you do not like the tooltip that the browser is showing (title attribute), you'll have to build your own.

The alt tab is also useful for supplying search engine spiders with information about what the image file represents.

What exactly are you trying to accomplish with this text?

Member Avatar for LastMitch

@pritaeas

alt is for displaying a text when the image isn't loaded. It is not meant to be a hint. If you do not like the tooltip that the browser is showing (title attribute), you'll have to build your own.

Thanks for the reply! I apologized for not explain it clearly. I attached an image to show what I want to do.

How do I make that word "Break" go to the second line.

Do I need to used CSS to make it work? My <div> doesn't have any CSS in it.

215

Member Avatar for LastMitch

@JorgeM

The alt tab is also useful for supplying search engine spiders with information about what the image file represents.

What exactly are you trying to accomplish with this text?

Thanks for the reply! No, it has nothing to do with search engine. I attach a image to show what I want to do.

Do I need to used CSS to make it work? My <div> doesn't have any CSS in it.

Just make that div the same width as the image.

commented: Thanks for the suggestion! +5
Member Avatar for LastMitch

@pritaeas

Just make that div the same width as the image.

Thanks for the suggestion! I will make the adjustment now!

Member Avatar for LastMitch

@pritaeas

It work! The word "break" is on the second line now! I appreciate it your help! Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.