-4

As per the title, i am trying to change my from this "EXAMPLE TITLE" to this "ExaMple title".

Please note that i am using two uppercase characters in the same sentence. If that is not possible then can you recommend a css that would make it sentence case like this "Example title"

EDIT:I already have some suggested duplication of my post, but i am looking for a different thing. I have to use the tag for SEO purposes which forces the character to become uppercase so i need to have a lowercase css for a few of the characters not the whole sentence

Angelo D.
  • 5
  • 1
  • 7
  • Possible duplicate of [make the first character uppercase in css](http://stackoverflow.com/questions/5577364/make-the-first-character-uppercase-in-css) and http://stackoverflow.com/questions/15994270/style-the-nth-letter-in-a-span-using-css – John Mar 08 '17 at 14:56
  • Thanks that is different though. I have to use the

    tag for SEO purposes which forces the character to become uppercase so i need to have a lowercase css for a few of the characters not the whole sentence

    – Angelo D. Mar 08 '17 at 15:10
  • There is NO CSS method to do this. You will either need alternative HTML or Javascript. – Paulie_D Mar 08 '17 at 17:08

2 Answers2

2

Ciao Angelo, I can’t help you with your first case “ExaMple title” but I’m pretty sure you can get “Example title” with the following code:

HTML:

<h1>EXAMPLE TITLE</h1>

CSS:

h1 { text-transform: lowercase; }
h1:first-letter { text-transform: uppercase; }

EDIT: You wrote that H1 tag forces your text to uppercase, this is not a standard behavior of that tag, this means that you have already a CSS rule like this:

h1 { text-transform: uppercase; }

Can’t you remove that line from your current CSS?

DanieleAlessandra
  • 1,380
  • 1
  • 12
  • 21
  • 1
    Why was my answer downvoted? I think that I am in topic and really trying to help. – DanieleAlessandra Mar 10 '17 at 15:58
  • 1
    I think this is a good answer, maybe missing this [jsfiddle](https://jsfiddle.net/j8pabsvj/) :) But i rather guess that someone wanted to discourage you from answering what he thought was a bad question, until the question was improved by the OP. Don't take it personally. – Samuel Kirschner Mar 10 '17 at 16:36
0

you can do like this

HTML :

<h1>ExaMple title</h1>

CSS :

h1 {font-variant-caps: unicase;}

This will result as the HTML input.

ExaMple title

I prefer this way usually when attach unique key such as token ID which have upper & lower case in mix order