Questions tagged [inline-styles]

An inline style is one that is defined within an element that the style applies to. This is not specific to HTML so please include the appropriate language tag as well.

389 questions
3
votes
1 answer

How to Center React Component Horizontally and Vertically Using Inline Styles

I'm trying to center a basic user login in React JS using inline styles, but I can't seem to figure out how to do it. I'm using React Bootstrap and I have currently managed to partially center the form using flexbox, but it's still appearing at the…
clattenburg cake
  • 1,096
  • 3
  • 19
  • 40
3
votes
1 answer

MaterialUI: Why does setting background color on Select component hides the InputLabel text and how could I avoid it happening?

Basically I'm just trying to change the background color on dropdown elements but I also would like to keep the default text showing there. Right now, if I don't set up background color explicitly on the Select component, text specified in…
Konstantink1
  • 575
  • 1
  • 8
  • 26
3
votes
1 answer

What is the actual difference between using an inline-style and using a css-in-js library like styled components in React?

Writing an inline style in js, const styles = { background: 'blue', color: 'white' } and using it in the JSX as below
I am a div
Writing the styles using 'styled components', const Div= styled.div` …
Tinu Jos K
  • 888
  • 1
  • 8
  • 21
3
votes
1 answer

Using grid-template-columns in ReactJS, inline style

Im trying to use the CSS grid in a React component, but I get an error in the first dash of grid-template-columns, any ideas why this happens?
Tapioca
  • 309
  • 3
  • 7
3
votes
2 answers

How to programmatically check CSS styles for particular elements?

I can easily check what CSS style an element has if it was applied inline:

This is red

The JS to read that color: document.querySelector('p').style.color == 'red' How can I check the CSS style of an element if that style…
at.
  • 50,922
  • 104
  • 292
  • 461
3
votes
1 answer

React: Flexbox using inline styles with react router

I am using react router to navigate to different routes in my application on sidebar. I am using inline styling for react for all the designs. Moreover, I am using flexbox to achieve design. I am new to flex and haven't completely grasped the…
Umair Sarfraz
  • 177
  • 3
  • 5
  • 16
3
votes
3 answers

Why is a difference between inline CSS and normal CSS

I did just want to answer a question and I fall on something I dont understand! Why the result is not the same if I use inline CSS or CSS in a file like the color in this case! The code is the same but the 1st paragraph is green and the 2nd red! I…
CodeWeis
  • 846
  • 6
  • 19
3
votes
2 answers

CKEditor doesn't apply inline styles to links

I'm using ckeditor version 3 as a text editor to create markup to be sent through email. This means that I have to have all the styles inline and anything that needs to be styled will definitely need the style applied. I'm currently using…
JohnP
  • 49,507
  • 13
  • 108
  • 140
3
votes
2 answers

React styles prop returns [object object] for an array?

I've got this very basic component: Tile = React.createClass({ render: function(){ var styles = [ TileStyles.tile ]; return (
); } }); Unfortunately…
gbachik
  • 1,637
  • 3
  • 17
  • 29
3
votes
1 answer

How can I change the inline style text color of an element without the ability to add a class or id?

As I asked in Is it possible in css to give a color name an alternative HEX value? and apparently no one understand what i was asking probably due to my bad way of questioning, I think I should repost the question with some better wording: There is…
user930067
  • 276
  • 3
  • 10
3
votes
5 answers

Inline style being ignored

I have a fairly simple cell in a table with an inline style: Current Status: And the text-align-right is being ignored, both in Firefox and Opera. I used Firefox's "firebug", and it shows me for…
doxguy
  • 185
  • 1
  • 3
  • 11
3
votes
1 answer

print a web page with inline css

I want to print an html table with inline style for particular cells. This is the image of the table. but when I print this web page out. the colors for those cells disappear. This is the image of the print preview. This is the code sample of the…
Kevin Bui
  • 2,754
  • 1
  • 14
  • 15
3
votes
2 answers

CSS ::selection inline

I have a div, and I want to change the selection style. It works fine like this:
Text text
The problem is that I want to send it in the email, so it has to be…
HTMHell
  • 5,761
  • 5
  • 37
  • 79
2
votes
0 answers

ReferenceError when using css filter functions with inline styling

I get this error: "ReferenceError: sepia is not defined". I know I can fix this by writing css in its own file, but I need to make it work inside jsx to programatically change…
2
votes
1 answer

Content Security Policy (CSP) - problem with dynamic inline style during onetrust integration

I am integrating a cookie tool - onetrust. I add them by adding scripts in the of the html page. The scripts call other scripts and create inline styles. I manage to embrace all scripts by adding a 'nonce' to this scripts. I have a problem with…