Positioning an icon in p.note style
Positioning an icon in p.note style
Hello
I have created a class of the p tag: p.note, which I use to highlight notes in my document. I have added an image (note icon) but cannot seem to position it correctly.
To position it, I went to the Background tab in the properties within the stylesheet. First I selected X Left and Y Top, this positions my icon too high in the box: I then changed it to X Left and Y Center, which is fine if the note only takes up one line, but if it goes onto multiple lines then it is centered relative to all text, rather than just the 'Note:' text, which is what I want: Does anyone know how I can position this icon so it is centered relative to just the 'Note:' text (which I added using the autonumber function).
Many thanks
Clare
I have created a class of the p tag: p.note, which I use to highlight notes in my document. I have added an image (note icon) but cannot seem to position it correctly.
To position it, I went to the Background tab in the properties within the stylesheet. First I selected X Left and Y Top, this positions my icon too high in the box: I then changed it to X Left and Y Center, which is fine if the note only takes up one line, but if it goes onto multiple lines then it is centered relative to all text, rather than just the 'Note:' text, which is what I want: Does anyone know how I can position this icon so it is centered relative to just the 'Note:' text (which I added using the autonumber function).
Many thanks
Clare
You do not have the required permissions to view the files attached to this post.
Re: Positioning an icon in p.note style
To move the icon down slightly, just set a px value for the background Y value; e.g. 4px.
-
- Sr. Propeller Head
- Posts: 373
- Joined: Tue Apr 23, 2013 3:19 am
- Location: The Netherlands, Amsterdam Area
Re: Positioning an icon in p.note style
similar thread: http://forums.madcapsoftware.com/viewto ... nd#p103176
the position settings don't work there, when using pixels ...
the position settings don't work there, when using pixels ...
Using Flare 10.2 and Flare 11 on Win 7
Re: Positioning an icon in p.note style
BTW, that's a bad link.Lydia wrote:similar thread: http://forums.madcapsoftware.com/viewto ... nd#p103176
the position settings don't work there, when using pixels ...
It appears the background position in Simplified view doesn't work (it uses CSS that isn't supported by many browsers).
I tend to use Advanced view, so I'd not seen that before.
Anyway, use the background-position property (available in advanced view); you set the x and y positions with a space in between, e.g. 0px 4px.
-
- Propeller Head
- Posts: 33
- Joined: Mon May 19, 2014 9:01 am
Re: Positioning an icon in p.note style
I used the background-position property (with percentages), and it looks awesome when I have a note that’s just 1-3 lines of text, but the problem with using percentages is that, as the note gets longer, the icon moves further down inside the note box.
Just like the original poster, I’d like for the icon to always stay aligned with the word “Note†at the top, so I tried to use pixels instead of percentages, but when I do this, the background image doesn’t show up at all. I’ve tried just 1px 1px and up to 50px, and the image just doesn’t show up. Not sure what this is all about…
If anyone has an idea of how to fix this, I am all ears!
Just like the original poster, I’d like for the icon to always stay aligned with the word “Note†at the top, so I tried to use pixels instead of percentages, but when I do this, the background image doesn’t show up at all. I’ve tried just 1px 1px and up to 50px, and the image just doesn’t show up. Not sure what this is all about…
If anyone has an idea of how to fix this, I am all ears!
Re: Positioning an icon in p.note style
Setting the background position in px works fine for me, using PNG images in a HTML5 output.
I'm not sure if px works for PDF though; PDFs have a few issues with background images.
I'm not sure if px works for PDF though; PDFs have a few issues with background images.
-
- Sr. Propeller Head
- Posts: 373
- Joined: Tue Apr 23, 2013 3:19 am
- Location: The Netherlands, Amsterdam Area
Re: Positioning an icon in p.note style
I'm sorry for the wrong link, it should have been this one: http://forums.madcapsoftware.com/viewto ... =9&t=19721
@ Dave - which tag are you using, it seems a bit like the p tag does not work well with background-position and pixels. I'm looking at html5 output. The p.note tags don't show the icon, the div.note tags (with a p inside) do show it.
@ Dave - which tag are you using, it seems a bit like the p tag does not work well with background-position and pixels. I'm looking at html5 output. The p.note tags don't show the icon, the div.note tags (with a p inside) do show it.
Using Flare 10.2 and Flare 11 on Win 7
Re: Positioning an icon in p.note style
I use p tags (and div tags) that have background-position set using pixels; they work fine for HTML5 and WebHelp.Lydia wrote:@ Dave - which tag are you using, it seems a bit like the p tag does not work well with background-position and pixels. I'm looking at html5 output. The p.note tags don't show the icon, the div.note tags (with a p inside) do show it.
Re: Positioning an icon in p.note style
Thanks all for your help.
Dave Lee, that has worked perfectly for me.
Sorry for slow response, I didn't get the usual email telling me someone had replied to my post!
Thanks again,
Clare
Dave Lee, that has worked perfectly for me.
Sorry for slow response, I didn't get the usual email telling me someone had replied to my post!
Thanks again,
Clare
Re: Positioning an icon in p.note style
Yay! Just how I wanted it!
You do not have the required permissions to view the files attached to this post.
Re: Positioning an icon in p.note style
Ah yes I've realised now. This works fine for HTML5, but still can't get it to work for PDF.
Re: Positioning an icon in p.note style
You could try using an unordered list and setting the list-style-image property. You have less control on placement of the image though. But it might be worth a look for you.
Something like this:
.Note {list-style-image: url('MyImage.png');
background-color: lightblue;
border: 1px solid darkblue;}
<ul class="Note">
<li>Note: Peter Piper picked a peck of pickled peppers. If Peter Piper picked a peck of pickled peppers, how many peppers did Peter Piper pick? She sells seashells by the sea shore. If she sells seashells by the sea shore, how many sea shells does she sell? Peter Piper picked a peck of pickled peppers. If Peter Piper picked a peck of pickled peppers, how many peppers did Peter Piper pick? She sells seashells by the sea shore. If she sells seashells by the sea shore, how many sea shells does she sell?</li>
</ul> * list-style-image on the ul may or may not work for all browsers - I'm not sure it's entirely kosher, but have a play on the li and see what happens too.
Something like this:
.Note {list-style-image: url('MyImage.png');
background-color: lightblue;
border: 1px solid darkblue;}
<ul class="Note">
<li>Note: Peter Piper picked a peck of pickled peppers. If Peter Piper picked a peck of pickled peppers, how many peppers did Peter Piper pick? She sells seashells by the sea shore. If she sells seashells by the sea shore, how many sea shells does she sell? Peter Piper picked a peck of pickled peppers. If Peter Piper picked a peck of pickled peppers, how many peppers did Peter Piper pick? She sells seashells by the sea shore. If she sells seashells by the sea shore, how many sea shells does she sell?</li>
</ul> * list-style-image on the ul may or may not work for all browsers - I'm not sure it's entirely kosher, but have a play on the li and see what happens too.
You do not have the required permissions to view the files attached to this post.