Custom icons before the text
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 21
- Joined: Mon Dec 05, 2022 9:35 am
Custom icons before the text
Post by [Stupid]_[User] »
Hello everyone!
I want to customize some parts of my document. Now I'm trying to add icons before blocks of text (for example I have a lot of tips in my document and I really want to separate them from the normal text). I found a lot of amazing icons in the Internet for this, but I can't add them before the text. Example below:
I want to customize some parts of my document. Now I'm trying to add icons before blocks of text (for example I have a lot of tips in my document and I really want to separate them from the normal text). I found a lot of amazing icons in the Internet for this, but I can't add them before the text. Example below:
exmpl.JPG
You do not have the required permissions to view the files attached to this post.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Custom icons before the text
Post by chrispitude »
Hello Mr. User,
This looks like you are trying to customize <note> elements.
The customization work depends on which transformations you are using. Each transformation is configured differently. The CSS-based transformations (pdf-css-html5, html, and webhelp-responsive) are the easiest to configure.
This looks like you are trying to customize <note> elements.
The customization work depends on which transformations you are using. Each transformation is configured differently. The CSS-based transformations (pdf-css-html5, html, and webhelp-responsive) are the easiest to configure.
-
- Posts: 21
- Joined: Mon Dec 05, 2022 9:35 am
Re: Custom icons before the text
Post by [Stupid]_[User] »
Hello chrispitude!
I trying to customize note elements but haven't such result as I want. Is it any way to delete background "speech buble" and add my own icon before the text? I using "DITA PDF - Based on HTML5 &CSS" transformation scenario.
At this moment I resolve my problem simpler and banausic:
1. I add output class for <p> that will be used as note.
2. I add following code to my css file:
*[class~='topic/p'][outputclass="NOTE"]:before{
content:url("NOTE_icon.png");
width:20px;
height:20px;
}
*[class~='topic/p'][outputclass="NOTE"]{
font-size: 14px;
font-family: arial;
line-height:100%;
margin-top:4px;
margin-bottom:2px;
margin-left:1cm;
}
Customize standard note sounds better and not so banausic. I'll be grateful if you'll help me with it
.
I trying to customize note elements but haven't such result as I want. Is it any way to delete background "speech buble" and add my own icon before the text? I using "DITA PDF - Based on HTML5 &CSS" transformation scenario.
At this moment I resolve my problem simpler and banausic:
1. I add output class for <p> that will be used as note.
2. I add following code to my css file:
*[class~='topic/p'][outputclass="NOTE"]:before{
content:url("NOTE_icon.png");
width:20px;
height:20px;
}
*[class~='topic/p'][outputclass="NOTE"]{
font-size: 14px;
font-family: arial;
line-height:100%;
margin-top:4px;
margin-bottom:2px;
margin-left:1cm;
}
Customize standard note sounds better and not so banausic. I'll be grateful if you'll help me with it

-
- Posts: 675
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Custom icons before the text
Post by julien_lacour »
Hello,
If you want to change standard DITA <note> element, you can follow this topic from our user-guide.
If this topic is unclear, don't hesitate to give your feedback, it will help us make the user-guide better!
Regards,
Julien
If you want to change standard DITA <note> element, you can follow this topic from our user-guide.
If this topic is unclear, don't hesitate to give your feedback, it will help us make the user-guide better!
Regards,
Julien
-
- Posts: 21
- Joined: Mon Dec 05, 2022 9:35 am
Re: Custom icons before the text
Post by [Stupid]_[User] »
Hello, Julien!Hello,
If you want to change standard DITA <note> element, you can follow this topic from our user-guide.
If this topic is unclear, don't hesitate to give your feedback, it will help us make the user-guide better!
Regards,
Julien
I read the topic, which you are linked for, but I didn't found answers for my questions.
First of all I didn't understand how I can delete "speech buble" (I wrote this earlier in this post).
Secondly I can't dele "NOTE" text before my NOTE (I apologize for the pun).
Thirdly I didn't inderstand how to change standart icon to my own icon.
I don't need my NOTE have background image, I only need my custom icon near.
I show all my questions on the pic below. Hope it'll help to unerstand my strange requirements.
Capture.PNG
You do not have the required permissions to view the files attached to this post.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Custom icons before the text
Post by chrispitude »
Hi Mr. User,
Whenever I want to change something in the CSS, my first step is to see what rules are applied and where they are coming from, using the CSS inspector of my favorite browser.
I suggest using the CSS inspector to see how the default icon is applied, then apply your own icon using the same CSS selector. For example, I can see that the default note icon is applied like this:
so perhaps you could either apply your own image in the same way to override the default image by setting background-image to your icon, or you could suppress that image (perhaps setting background-image to none), then apply your icon in some different way, such as using a ::before CSS selector or something like that. (But generally, I try to override default styles in the same way that they were originally applied.)
I see that the topic Julien mentioned covers exactly these suggestions, so it is a good reference.
For the note title, the CSS inspector will show the following structure:
so perhaps you could apply a rule like
to hide it.
Whenever I want to change something in the CSS, my first step is to see what rules are applied and where they are coming from, using the CSS inspector of my favorite browser.
I suggest using the CSS inspector to see how the default icon is applied, then apply your own icon using the same CSS selector. For example, I can see that the default note icon is applied like this:
image.png
so perhaps you could either apply your own image in the same way to override the default image by setting background-image to your icon, or you could suppress that image (perhaps setting background-image to none), then apply your icon in some different way, such as using a ::before CSS selector or something like that. (But generally, I try to override default styles in the same way that they were originally applied.)
I see that the topic Julien mentioned covers exactly these suggestions, so it is a good reference.
For the note title, the CSS inspector will show the following structure:
image.png
so perhaps you could apply a rule like
Code: Select all
span.note__title { display: none; }
You do not have the required permissions to view the files attached to this post.
-
- Posts: 21
- Joined: Mon Dec 05, 2022 9:35 am
Re: Custom icons before the text
Post by [Stupid]_[User] »
Hi, Chrispitude!chrispitude wrote: ↑Tue Dec 20, 2022 2:27 pm Hi Mr. User,
Whenever I want to change something in the CSS, my first step is to see what rules are applied and where they are coming from, using the CSS inspector of my favorite browser.
I suggest using the CSS inspector to see how the default icon is applied, then apply your own icon using the same CSS selector. For example, I can see that the default note icon is applied like this:
image.png
so perhaps you could either apply your own image in the same way to override the default image by setting background-image to your icon, or you could suppress that image (perhaps setting background-image to none), then apply your icon in some different way, such as using a ::before CSS selector or something like that. (But generally, I try to override default styles in the same way that they were originally applied.)
I see that the topic Julien mentioned covers exactly these suggestions, so it is a good reference.
For the note title, the CSS inspector will show the following structure:
image.png
so perhaps you could apply a rule like
to hide it.Code: Select all
span.note__title { display: none; }
CSS Inspector helped me a lot! Now I resolved most of my style problems.
BIg thanks for your advice!!
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service