Jump to content

Very basic HTML question


Recommended Posts

Im trying to have a * red and then a text. But the code I write keeps spacing the from each other. Any idea what im doing wrong?Im trying to do this:Note * indicates a required fieldand another where it saysEmail address: *I know this is very simple but I cant seem to get the code right. Everytime I do the text goes one space down.

Note <p style="color:red;">*</p> indicates a required fieldEmail Address:<p style="color:red;">*</p>

Thanks in advance! :)

Edited by adam1
Link to comment
Share on other sites

that's because <p> is a block level element, and by default they start on their own lines. however, this is exactly what the <span> is for, which is an inline element by default and will not break to a new line.

Note <span style="color:red;">*</span> indicates a required fieldEmail Address:<span style="color:red;">*</span>

you would probably want to consider making a class for the red text style though.

Edited by thescientist
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...