Javascript Image Slider / Posts /

How to style the text on slides?

1

So, there is no way to style the text you put on the slide?

Since you cannot style alt tags with css, it's a no-no. You can style the title, but it does not seem to effect it whatsoever, apart from color and text-align(which you can also style with the alt-tag). I'd really need a way to place the text where i want, with a background and margins/padding. Is that possible?

Pelinox  7 years ago   viewed: 2720    

6 Answers

1

You need to set: #hello {position:absolute;}

And #slider {position:relative;}

Peter   7 years ago
0

Ahhhh, thank you very much :)

Pelinox   7 years ago
0

Why no-no? You can style it with CSS.

Note you also need to set its font-size as well to override its default font-size:0; settings.

Peter   7 years ago
0

Because the 'alt' tag cannot be instantiated in CSS. It will always be part of the image, thus, only allowing font-size, text-align etc. to be modified, any margins, padding, background etc. will also affect the image(slide).

Pelinox   7 years ago
0

But you can use the element selector such as title="#htmlcaption1"

For details please click the "How do I add HTML caption to a slide image?" link in http://www.menucool.com/javascript-image-slider#view2

Peter   7 years ago
0

I already did that. It changes nothing, unfortunately. It's not possible, as I wrote, once you add, say a margin, the margin affects the entire slide and not just the text.

This is how the slide looks without any text: http://i.imgur.com/T57zr6c.jpg

This is with the code below added, for text: http://i.imgur.com/i1IgUxm.jpg

<div style="display: none;">
<div id="caps1">
<p id="hello">hello world!</p>
</div>
</div>

<div id="sliderFrame">
<div id="slider">
<a class="lazyImage" href="slide1.jpg" title="#caps1"></a>
</div>

#caps1{
margin-top: 100px;
background-color: red;
}

#hello{
margin-top: 100px;
background-color: red;
}

Pelinox   7 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: