leplla Posted September 25, 2020 Share Posted September 25, 2020 Hi, I'm trying to highlight particular text lines with this code, below. It all works great apart from when I've added the code my text lines go left-justified rather than centered despite "text edit" showing center. Any tips? -- // Highlighted Text // h2 { background-image: linear-gradient(to top, #fcd5ce 50%, transparent 50%); width: auto; display: inline; } h3 { background-image: linear-gradient(to top, #ffe5d6 50%, transparent 50%); width: auto; display: inline; } h4 { background-image: linear-gradient(to top, #f8edeb 50%, transparent 50%); width: auto; display: inline;\h2 { background-image: linear-gradient(to top, #fcd5ce 50%, transparent 50%); width: auto; display: inline; } } Link to comment
tuanphan Posted September 26, 2020 Share Posted September 26, 2020 Hi. If you use display inline text-align: center won't work. Can you share link to page where text on. We can take a look? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
leplla Posted September 27, 2020 Author Share Posted September 27, 2020 20 hours ago, tuanphan said: Hi. If you use display inline text-align: center won't work. Can you share link to page where text on. We can take a look? Hi, thank you for your answer! What should I change in the code to have highlighted text that I can change around in the text editor in terms of alignment? I'm doing a private client project and don't really want to share it publicly 😬 Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.