html

Background Color Size fit with Text?  #angularjs #reactjs

  • Stack Overflow works best with JavaScript enabled
  • You can just display your h1 as a table-cell and add the required padding around the text.
  • I tried display: inline and padding , but I couldn’t figure out how to set the background to fit with the text responsively, rather than being full width.
  • I look to make the blue background color scale to fit with the text, “My Pet”.
  • The way you can set opacity of bgImage

See my codepen. I look to make the blue background color scale to fit with the text, “My Pet”. I tried display: inline and padding, but I couldn’t figure out how to set the background to fit with the text responsively, rather than being full width. Also, how can I set the opacity of the background color but not the text?

@ng_real_ninja: Background Color Size fit with Text? #angularjs #reactjs

, but I couldn’t figure out how to set the background to fit with the text responsively, rather than being full width. Also, how can I set the opacity of the background color but not the text?

After googling, I still struggle to find a solution.

HTML:

CSS:

.myDiv { text-align: center; } .myDiv h1 { display: inline-block; font-family: ‘Gabriela’, serif; color: #FFF; font-size: 3.5em; border-radius: 20px; background: rgba(43, 166, 203, 0.5 /* alpha value for background */); padding: 0.5em 0.2em 0.8em 0.5em; }

html

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.