Capitalizing just one word in HTML

Does anybody know how to capitalize just one word in an HTML doc? It has to be using CSS and the style tag. I have created my own taglines “tagl1” and “tagl2” and I need to capitalize just one word in each of these taglines but for life of me I can’t find any info on how to do this. And I’ve tried all suggestions. Can anyone help?

Depending on what you want to do, you can use the css property text-transform: capitalize

1 Like

Can you show us your code to see what you are doing

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Thank you for your reply! Here are the taglines I have created in one image and then I have to enter the style code in another box between Style tags. So I need to capitalize the words “sharp” and “timeless” and make them both bold.

I have tried this but it doesn’t seem to work…

I think I may have created the taglines incorrectly…

tagl1 and tagl2 are not valid html elements

Ok, I was told to create my own taglines that don’t already exist in the code… this is the task: * You should identify and create the right tags yourself and not use ones that exist in the HTML already. These taglines should each be within their own HTML tag.

I am not sure what you mean by tag line? Do you have any information on whoever told you to do that on what they mean by tag lines?

you can have the text in a paragraph element, and then use a span to surround the one word, and use css to text transform hat word to be capital

Sorry, I meant tags and this is the info they provided: Add two taglines to follow the header copy:* You should identify and create the right tags yourself and not use ones that exist in the HTML already. These taglines should each be within their own HTML tag.

Is this homework? They are not the best instructions, unless you have been learning something that should be obvious to you on what the instructions are telling you to use. There is no dedicated element for tag lines in html.

1 Like

No, this is an admissions test for Brain Station. I’m trying to get onto a software engineering course.

Maybe I can just use h3 and h4 since these are not already in the text?

That is really the only straightforward answer I can think of. However, I have looked a few things up and everything is saying that a p element should be used for a tag line but you already have one

1 Like

Ok, thanks for your help. I’m going to go with the h3 and h4. However, how would I go about writing the code to capitalize just one word from the taglines and putting them in bold? I need to do it within style tags further up in the document…

that becomes another issue. Because to do that you would have to wrap that one word in a span and then use the text-transform property to make it capital. However, you already have a span there

Hmmm, yeah I don’t know what to do…I’m going to play around with it a bit and see if I can figure it out…thanks for all your help :slight_smile:

Please post actual code instead of a picture of your computer. Thanks

1 Like
<h5> Minimal, yet <span>sharp</span></h5> 
    h5 span {transform-text:uppercase}

this is what I have now tried but it doesn’t work

text-transform not transform text. You are also missing a semi colon at the end

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.