using CSS. So here is what I did: input[t...">

Styling an HTML Header Attribute Using CSS

I am trying to create a title attribute <input type="text"> using CSS. So here is what I did:

 input[type="text"][title] { font-style: italic; color: gray; } 

Everything works fine, but when I enter the data in the field, the data is gray and in italics. I want the data (value) to be normal and black, and only the header is italic and gray.

Any ideas?

+6
source share
3 answers

You can create your own solution using CSS3.

See How do I style the Title attribute inside an anchor tag? . But can I suggest you use a custom field of type name-data, so the default behavior of the browser does not interfere with your custom solution.

+4
source
 input[type="text"][title]:hover:after { font-style: italic; color:gray; } 
+1
source

You can add an input header to <h2></h2> , and then change the title property from css, as shown below:

 h2 { font-style: italic; color: gray; font-size: 1em; } 
+1
source

Source: https://habr.com/ru/post/948717/


All Articles