Do you ever wonder why text-alignment never works in HTML code?
Well there's two reasons to why this happens.
- You probably used a DIFFERENT type of code on accident. To prevent this from happening do this before you start typing:
<!DOCTYPE HTML>
Your-code
In "<!DOCTYPE HTML>", the HTML let's the HTML file know what version of *HTML" you are using.
- You probably tried to do this:
<!DOCTYPE HTML>
<html>
<head></head>
<body>
<button> <!-- I'm using button, use whatever you want. -->
<style>
button{ <!-- using "button" Is the biggest mistake that you can accidentally make -->
text-alignment: whatever-position-you-chose;
}
</style>
</button>
</body>
</html>
NEVER use text alignment by itself. If you do you text alignment by itself it will NOT work.
Instead of doing that do this:
<!DOCTYPE HTML>
<html>
<head></head>
<body>
<style>
btn { <!-- change btn to the nickname for your div class. -->
text-alignment: whatever-position-you-chose;
}
</style>
<div class="btn">
<!-- "class" gives a nickname for it's only child. "btn" is the nickname I gave for the button. You can choose any nickname for your text. -->
<button>your text here</button>
</div>
<style>
</style>
</body>
</html>
Tutorial for the most liked comment. 3 days to run it up🔥
Top comments (2)
Pls do how to set the style of a button pls pls pls. 🙏🙏🙏
Fine