Putting style (CSS) within div tags
I need to put the css attributes inside my div tags. The css cannot be inside the <head> tags, and it cannot be called from a separate file. It needs to be inside the <body> tags with the <div> tags.
Can anyone show a example of how to accomplish this? The main things I need is - Div height, Div width, Font size, Font color, image source.
THANK YOU SO, SO MUCH FOR YOUR HELP!!!!
It's called "inline CSS", like this:
Thank you so much! It's been a long time since I had to do this, and I don't do web coding that often, so I couldn't remember for the life of me. lol.
Thank you again.
How about if you want to add css rules for links? Such as link, visited, hover, etc...
Would this work?
Originally Posted by
/* rules go here */
Sorry, I'm not understanding...
If I have something like this -
<style="background-color: #036; height: 16px;"></style>
How do i add the link rules to the above style rule?
Thanks so much for your help.
You cannot style a selector like a:hover with inline styling like you asked above for the <div>. But if you can edit in the <head> section of your code, then that is always preferable over inline, and you could do it there as Criterion has suggested...
here is threee ways to insert css to your html
Users Browsing this Thread
There are currently 1 users browsing this thread.
(0 members and 1 guests)
Tags for this Thread