CSS StyleSheet – Horizontal align for javascript
Version: 43.3
Revision: 54 Build 143
CSS StyleSheet – Horizontal align for JavaScript
Introduction: there are times that your company has given you a piece of code that uses JavaScript language. But, when you added the following codes into your left or right table, it always placed itself right at the edge of your template. So, to work around this problem, you’ll need some knowledge on CSS and HTML format. However, this is only a hack to bypass some issue with IE browser.
1.] Download notepad++ from the original author or from a mirror and install the software.
——————————-
http://sourceforge.net/projects/notepad-plus/
http://filehippo.com/download_notepad/
——————————-
Part One: basic stylesheet knowledge…
————————-
a.] all “div” tags and “td” tags are very different.
But, the most important tags which are used for javascript is the “div” tags.
b.] Everytime you insert a javascript link, you’ll need to add these codes in order.
However, if you don’t follow this simple rules, your JavaScript will not be visible by other readers.
JavaScript – table orders: div >> script + noscript >> script + noscript – escaped >> div – escaped
c.] To align JavaScript (manually), you’ll need to insert “h2” tags. Without this tags, the browser will ignore your javascript floating point. So, you’ll need to add this after your div tags.
d.] All “td” tags have to be anchored into a “table” tag. Without it, your “td” tags and JavaScript will trigger errors and serious table overflow! But, please think carefully and take a look at your source before you continue.
Part Two: preparing your table and stylesheet
————————-
1.] Create a css stylesheet – file with this name: Java_ads.css
2.] Paste this source code into your css file and save it…
—Copy Source Code—
#adclass1, .adsbox {
float: left;
position:relative;
left: 10px;
right:0px;
}
—End Source Code—
Copyright 2001-2011 Lair360
Extra precaution: if you’re copying the above codes into your css stylesheet, you’ll need to hard – anchor your “.adsbox” tags before adding your id tags: “#adclass1”. If you don’t organize this code in their proper orders, then there would be problems…
.adsbox = primary class tags
#adsbox = id verification tags
3.] Now, open your page and add this code into your html page.
But, this code will need to be in your “td” tags and your table tags…
Tips: This technique is similar to an iframe. You can also use this source for ads template and make it float.
—Copy Source Code—
<div id="adclass1" class="adsbox"> <!-- Begin example code --> <SCRIPT LANGUAGE="JavaScript1.1" SRC="http://example-code.com/java_example.js" type="text/javascript"></SCRIPT> <noscript><a href="http://www.example-code.com">example</a></noscript> <!-- End example code --> <a href='http://www.copygator.com/website/lair360_co_uk/4540887.html'> <img class="gator2" src='http://i.copygator.com/?ci=4540887' border="0" vspace="1" /></img></a> </div>
—End Source Code—
Copyright 2001-2011 Lair360
Notes: you can also add an image source code. But, you must be very careful and add a backslash before adding an image – escape code. This will stop your “img” tags from colliding with your JavaScript tags.
4.] Save your html file and adjust your css stylesheet.
Tips: if your JavaScript is floating on your right – panel, then you’ll need to modify: “float position: right; left:0px; and right;10px;”.
5.] Finally, just add this code into your “head” ~tags. But, don’t put this last, or else, there will be some conflict!
—Copy Source Code—
<link rel='stylesheet' type='text/css' href="css_file/Java_ads.css" /></link>
—End Source Code—
6.] Finish!
Copyrighted by Lair360


