Member Avatar for leegeorg07

Hi, I have this code:

<style>
div.floating-menu {position:fixed;background:#fff4c8;border:1px solid #ffcc00;}
div.floating-menu a, div.floating-menu h3 {display:block;margin:0 0.5em;float:left;}
</style>
<div class="floating-menu">
<h3>Floating Menu</h3>
<a href="http://www.quackit.com/css/">CSS</a>
<a href="http://www.quackit.com/html/">HTML</a>
<a href="http://www.quackit.com/javascript/">JavaScript</a>
<a href="http://www.quackit.com/coldfusion/">ColdFusion</a>
<a href="http://www.quackit.com/myspace/codes/">MySpace Codes</a>
</div>

which I got from a website, I was wondering if there is a way I can have this imported into a website? I thought if I saved it I could do the same type of thing as css where you do that?

I didnt understand your question.. Please tel me it more clearly

Member Avatar for leegeorg07

sorry, what I meant is could I treat the code shown above like a css/js/php file and import it into other pages?

I bleileve you can import it in most cases. But the code given seems to be wrong.
Linking CSS can be done like
<LINK href="http://url/files/tabcontent.css" type=text/css rel=stylesheet>
Am not sure about this. U may ask to others too

Member Avatar for leegeorg07

no, the code validates fine, the css is embedded in the <style? tags, but I moved it into a css file. But thanks, I'll give it a shot

no, the code validates fine, the css is embedded in the <style? tags, but I moved it into a css file. But thanks, I'll give it a shot

Yes, you can add the code,what ever you like but the code is not 100% correct for cross browsers. Mainly in IE it will create issue, for that you have a use CSS hack, at first have to make the parent div positioned absolute for IE browser with conditional CSS hack.

Member Avatar for leegeorg07

oh, it all seems to work fine, but thanks anyway

Did you mean external css to embed in your document?
Here is import external css to document.

<style type="text/css">
<!--
@import url('yourcss.css');
-->
</style>
Member Avatar for leegeorg07

no, what I meant was external html, but it wouldn't have worked, so i changed it to php, so I could have a menu easily

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.