r/HTML • u/Girlmikenesmith • Sep 17 '26
Question Aligning widget to left side
As the title suggests, I am trying to move this widget to the left side of my website, so it aligns with the link in the center. I’ve tried style:”align:left;” but to no avail. Here is the code:
3
Upvotes


View all comments
Show parent comment
1
u/gastapo67 Sep 17 '26
No worries! If it’s showing up as text on the page, you probably pasted the CSS directly into the HTML body.
The easiest way is to put it inside a <style> tag near the top of your HTML:
<style> .widget { margin-right: auto; } </style>
Then you need to give the element you want to move the widget class. For example:
<div class="widget"> Your widget code here </div> The .widget part in the CSS basically means “apply these styles to anything with class="widget".” And no need to apologize — this is exactly how you learn CSS 🙂