CSS / HTML ? - Page 1 - Post ID 205405

User 2924428 Photo


Registered User
1,718 posts

Hey guy's, i've used this code in another webpage for css to create a new website, it's not working in the code as a stand alone box.. please check.
<style type="text/css">
<!--
body {
color:#000000;
background-color:#FFFFFF;
}
a { color:#0000FF; }
a:visited { color:#800080; }
a:hover { color:#008000; }
a:active { color:#FF0000; }
-->

#box1
{

height:250px;
width:250px;
padding:10px;
border:5px solid gray;
margin: 0 10px;
float: center;
}
</style>
User 187934 Photo


Senior Advisor
20,267 posts
Online Now

What have you broke now.:)

Attachments:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2924428 Photo


Registered User
1,718 posts

my pinky to be honest, but i havent quite figured out css yet :(
User 187934 Photo


Senior Advisor
20,267 posts
Online Now

Did you see what the arrow was pointing at?:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2924428 Photo


Registered User
1,718 posts

removed the arrows, code still isn't previewing..
<style type="text/css">
body {
color:#000000;
background-color:#FFFFFF;
}
a { color:#0000FF; }
a:visited { color:#800080; }
a:hover { color:#008000; }
a:active { color:#FF0000; }

#box1
{
border:5px;
height:500px;
width:500px;
float:left;
z-index:1000;
}
</style>
User 187934 Photo


Senior Advisor
20,267 posts
Online Now

Link?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 38401 Photo


Senior Advisor
10,951 posts

Take out the top line also that started that code. When you transfer your CSS from the HTML page you don't need to declare the Script section at all, just copy the raw CSS itself and skip the:

<style type="text/css">

</style>

part, so delete that first line and the last line that shows those 2 items above and you should be fine.


**EDITED BY ME LOL**
After I typed that above I realized you're using it within the HTML page itself so you do need what I have above. You would be much better off not doing it the way you're trying to and just create a CSS page to put your code in.
Create a new page in the HTML Editor or whatever program you use for basic text editing. Save it as something like:

style.css

Now inside that page put the code without all the style tags as mentioned above in my original part of my post.

Now in your HTML Pages at the top in the Head area create a link like so:

<link href="style.css" rel="stylesheet" type="text/css" />

Put that style.css right in your root site directory or you can create a folder named css for it and put it in there, just change the link above to reflect the actual location like so:

<link href="css/style.css" rel="stylesheet" type="text/css" />

Now you can use those style tags on all the pages that you include the above link in. This makes only one place to have to edit rather than needing to edit each page's css tags.
User 187934 Photo


Senior Advisor
20,267 posts
Online Now

I think He's embedding the style script not linking to a style sheet.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2924428 Photo


Registered User
1,718 posts

you guys wont believe me but i forgot the html in my page to create the css.. ive officially lost it.
User 38401 Photo


Senior Advisor
10,951 posts

lol now I don't feel so bad about my own blunders! hahaha

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.