2

I wrote CSS for my plugin, but theme CSS overwriting that, I have tried and searched for this I did not get any solution

This is my HTML code

 <html>
 <body>
 <img src="sample.gif" width="100" height="132">
 <h1>This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.</h1>
 </body>
 </html>

my CSS is

 img {
       float: right !important;
     }

And theme CSS is

  h1 {
       clear:both;
     }

I want my image to be displayed to the right side of h1 tag.

2
  • Plugin to what? CSS on tags instead of classes speaks to a bad theme definition to me. Commented Mar 26, 2018 at 11:54
  • 1
    what is the loading order of your css link and other link from theme? Commented Mar 26, 2018 at 11:55

1 Answer 1

3

Simply remove the clear on the title... if that's not possible, override it

img {
  float: right
}

h1 {
  clear: both !important
}

body h1 {
  clear: none !important
}
<img src="sample.gif" width="100" height="132">
<h1>This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.</h1>

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the answer @mayersdesign. it worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.