« Newer Snippets
Older Snippets »
27 total  XML / RSS feed 

tank_base_theme.css

// base

@charset "iso-8859-1";

/*******************************************************************************
*  tank_base_theme.css : 2005.09.01
* -----------------------------------------------------------------------------
*  Base Tank! theme. Applied to the layout by default. Theme modifications
*  applied via a style-switcher or external stylesheet should build upon what
*  is here. 
*******************************************************************************/

@import "http://webhost.bridgew.edu/etribou/layouts/utility_css/visual_consistencies.css";

p
{
        line-height: 140%;
}
body
{
        background-color: #fec;
        color: #000;
        background-image: url("../images/ruthsarian.png");
        background-repeat: no-repeat;
        background-position: 30px 100%;
        background-attachment: fixed;
}
#topMenu ul
{
        width: 12em;    /* make the pop menus a little wider */
}
#pageWrapper, #innerColumnContainer, #masthead, #footer, #topMenu, #topMenu ul, #topMenu a
{
        border-color: #c93;
}
div.twoColumns div.leftColumn, div.twoColumns div.rightColumn
{
        border-color: #ddd;
}
#pageWrapper
{
        background-color: #f9f9f2;
        color: #665;
        font-family: arial, helvetica, sans-serif;
        font-size: 80%;
        background-image: url("../images/ruthsarian.png");
        background-repeat: no-repeat;
        background-position: -110px 100%;
}
#masthead
{
        background-color: #dc8;
        background-image: url("../images/tank.png");
        background-position: 100% 100%;
        background-repeat: no-repeat;
        padding: 10px;
        color: #000;
}
#masthead h1
{
        font-size: 150%;
}
#masthead h2
{
        font-size: 260%;
        color: #862;
}
#outerColumnContainer
{
        background-color: #fff;
        color: #223;
        border-right-color: #fff; /* right column background color */
}

#contentColumn, #rightColumn, #masthead, #footer
{
        padding-top: 10px;
        padding-bottom: 10px;
}
#contentColumn
{
        padding-top: 0;
}
#topMenu
{
        border: solid 0 #c93;
        border-width: 4px 0 0 0;
        padding-right: 40px;
}
#topMenu li a, #topMenu li a:link, #topMenu li a:visited, #topMenu li a:active
{
        background-color: #ffe;
}
#topMenu li a:hover
{
        color: #fff;
        background-color: #c93;       /* keep the same color as the borders */
}
#rightColumn ul.rMenu
{
        margin: 0 5px 10px 5px;
}
#rightColumn ul.rMenu, #rightColumn ul.rMenu li a,  #rightColumn ul.rMenu li ul
{
        border-color: #ed9;
}
#rightColumn ul.rMenu a:link, #rightColumn ul.rMenu a:visited, #rightColumn ul.rMenu a:active
{
        background-color: #ffe;
        color: #336;
}
#rightColumn ul.rMenu a:hover
{
        background-color: #c93;
        color: #fff;
}
#rightColumn h3
{
        margin-bottom: 0;
        padding-bottom: 0;
        color: #b83;
        z-index: 999;
        line-height: 0.75em;
        font-size: 140%;
        /* \*/ position: relative;        /* With this here, IE/Mac will put this on 
                                           top of every other element in the page. so
                                           drop-down menus appear under. ick. so hide
                                           it with this hack. */
}

Ruthsarian Layouts - Tank!

// http://webhost.bridgew.edu/etribou/layouts/Tank!/index.html

DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                <style type="text/css" media="screen">
                
                style>
                /theme/blue.css" media="screen">
                "alternate stylesheet" title="green : color" href="css/theme/green.css" media="screen">
                "alternate stylesheet" title="camille : color" href="css/theme/camille.css" media="screen">
                "alternate stylesheet" title="gray : color" href="css/theme/gray.css" media="screen">
                "alternate stylesheet" title="black : color" href="css/theme/black.css" media="screen">
                
                
                Tank! : Ruthsarian Layouts
        
        "en">
                
"pageWrapper">
"masthead">

Ruthsarian Layouts

Tank!


"hide">
"outerColumnContainer">
"innerColumnContainer">
"contentColumn">
"inside">
"twoColumns">
"leftColumn">
"inside">

Introduction

Tank! is CSS-based web page layout. The goal for this layout was to incorporate several tricks/features that help further demonstrate the versatility of CSS. These include drop-down menus, theme switching, changing font size, source ordering, transparent images, multiple columns, and hopefully some nice style.

A Work In Progress

I'm releasing this layout a little early. It's still a work in progress. IE 5.0 (for Mac OS 9 and earlier) has some severe bugs that cause the text to not appear correctly; however IE 5.2 works just fine. Netscape 7.0 has a problem with the drop-down menus where they are displayed in the flow of the document, forcing the rest of the page's content down while the drop-menu is displayed. There is no Netscape 4 specific stylesheet at the moment. NS4 users will simply see a plain page. Oh, and if you figure out my not-completely-documented dropdown system and try to apply it to the vertical menu, you may run into some problems, so I wouldn't try it right now.

Feel free to send an e-mail to ruthsarian at gmail dot com if you find other bugs that you'd like to report.

No Zip (Yet)

I'm not yet providing an archive of the layout with all the necessary CSS and JavaScript and all the paths worked out, etc.. in a single ZIP ready to go. This is because I don't consider this layout to be ready enough. If you want to take this layout for a test drive, you'll have to figure out how to pull out the CSS, HTML and JavaScript needed. This isn't hard at all, but if you don't know how then you probably aren't ready to use a layout that may still be a bit... touchy.

Short on documentation

I'll try to add more documentation to this page as I have time. Right now I'm focusing in on the more important pieces of information about this layout, rather than worry about a full write-up on all the intricacies.

"rightColumn">
"inside">

Gargoyles - Season 2, Vol. 1

"http://www.amazon.com/gp/product/B000ATQYVA/">Gargoyles - Season 2, Volume 1 was released on December 6, 2005. The DVD contains the first half (26 half-hour episodes) of the second seasion of "http://tv.disney.go.com/jetix/gargoyles/">Gargoyles. Special features include commentary on the 4-part "City of Stone", a featurette on the making of with new interviews of several cast members, and introductions of each episode by creator "http://www.s8.org/gargoyles/askgreg/">Greg Weisman.

Support / Donations

Every so often I hear from someone who offers to make a donation or asks about ways to support my work. My position, as outlined in the content of the "http://webhost.bridgew.edu/etribou/layouts/skidoo_too/gargoyles/index.html">Skidoo Too: Gargoyles layout, remains the same: I don't want money. I'm not trying to make money, I just want to share with others my own bits of work with CSS. I think the knowledge I gain from my own work is its own reward (regardless of how corny that sounds).

However, if you would like to support a cause near and dear to me, I would ask that you pick up a copy of "http://www.amazon.com/gp/product/B000ATQYVA/">Gargoyles - Season 2, Volume 1. Gargoyles is a great show, well written, and entertaining to both kids and adults. I would like to see the show continued in some manner, but to do that we need to first get "http://www.disney.com">Disney's attention. That can be done through increasing salse of the latest "http://www.amazon.com/gp/product/B000ATQYVA/">Gargoyles DVD. If it sells well enough to make a blip on the radar of Disney's executives, if they think they can make money with it, Disney might just start producing new content (episodes) of the show. That would be something I would really like to see.

So I ask that you pick up a copy of the DVD if you get the chance. I think you'll enjoy it if you take the time to watch the show. This is not just a kids' show and adults will absolutely enjoy it as much as (if not more than) children. But, if you've got no interest, the least you can do is give it to a family member or friend who might be interested, or have children. It makes a great holidy gift!

"clear">

Everything To The Right

Key design issue is that the typical vertical menu you see in many web pages is included here. What isn't typical is that this menu is moved to the right side of this layout. The horizontal menu at the top of the page is also right-aligned.

Why is this?

This goes back to an old lesson in a Photoshop 3 book I read a long time ago. It recommended you move the toolbar over to the right side of your window. The reason being that it keeps the scroll bars closer to your toolbar, creating less distance for the mouse to travel and, thus, less movement for your hand. It helps relieve a small amount of work (and stress) on the hand. It's also easier to navigate, in general, for right-handed people, which make up the majority of the people in the world. And it's something new and different so I wanted to give it a try.

That large margin/gutter/gap on the left of the layout is there to help reenforce the eyes to the right side of the page. The empty space also is a nice spot to catch when reading left to right and moving down a line. I also think it's visually interesting, but you can go ahead and delete it if you don't like it. It doesn't serve any critical function except to free up an otherwise busy layout.

Utility Stylesheets

Several stylesheets used in this layout are part of my "http://webhost.bridgew.edu/etribou/layouts/utility_css/">utility stylesheets collection. The point of these stylesheets is that they provide specific functionality that I use in several layouts. Rather than keeping several different copies of (basically) the same stylesheet, I've put them into one place. That way if a bug pops up in the drop-down menu stylesheet, I can fix one stylesheet and all my layouts that use it will be immediately updated.

JavaScript

The goal is to rely on CSS as much as possible and to keep the layout functional even without JavaScript enabled. Despite this constant goal with all "/etribou/layouts/">Ruthsarian layouts, there is a fair amount of "/etribou/layouts/javascript/ruthsarian_utilities.js">JavaScript used in this layout. A lot of it is there to provide a helping hand to some browsers that either don't support full CSS or have a broken implementation of some CSS features.

For example, IE does not support the :hover

pseudoclass on
elements other than anchor tags. As a result, the drop-down menus don't work. JavaScript
is used to apply an extra CSS class to list items while the mouse is over the element
to emulate the
:hover
pseudoclass. Position and appearence of the drop-down
menus is handled by CSS. If/When IE supports the
:hover
pseudoclass, this
bit of JavaScript can be removed and the drop-down will function completely without
JavaScript. Drop-down menus will work fine with FireFox
and several other new generation browsers without that JavaScript.



Other implementations of JavaScript in the layout bring functionality most likely already
available through a browser menu option into the page itself. One example of this is
the style switcher. Several browsers already support the switching or application of alternate
stylesheets (if defined) to a web page. The style switcher provides a different interface to
this feature. The same with the font size changing system. Almost all browsers offer a feature
to increase the base font size of the browser. This font size system just brings that interface
into the web page.



The point is this: you can remove all JavaScript from this layout and it will still
function. The only thing you lose is some ease-of-use accessories for the user and/or
minor compatibility issues that, by themselves, will not break the layout.



Quick Bits



Cookies are used to store the prefered font size and style so it remains through each
page visit.



If the page has short content the footer will
fill in the space between the bottom of the layout and the bottom of the
browser window.



Style switcher and font size setter HTML are created via JavaScript
document.write()
.
This way users who do not have JavaScript enabled will not see the interface for this JavaScript
dependant features.



The name Tank! comes from the song by the same name recorded by the Seatbelts. It is the
theme song to the anime series Cowboy Bebop. I was listening to that song when I decided
to finally name this layout. If you haven't, I highly recommend picking up Cowboy Bebop,
both the DVDs and the soundtracks (of which there are many).










Stylesheets




Theme Styles




JavaScript


    > >ruthsarian_utilities.js >


References


    > >css-discuss.org > >CSS Filters >
  • Piefecta Demo Layout > >Douglas Livingstone's 3-Column Layout > >456 Berea Street > >Explore Color >


Menu Example


    >
  • >Layouts
      > >Tank! > >Gargoyles > >Skidoo Too >
    • >Skidoo
        > >Fixed Width > >Fluid Fixed Width > >Detached Masthead > >Border Into Masthead > >Background Images > >Gutterless > > >
      • >Experiments
          > >Plaine > >Nausicaä > >Bob > > > > > >Labs >
        • >Blog
            > >Web of Information > >Cold Fusion > >Informational > > > > >



















to html layouts Ruthsarian by dividespace on Oct 27, 2006

findout browser

// the navigator object stores the browser ...

<script type="text/javascript">
document.write("Your browser is " + navigator.appName);
script>

Mask address bar so always set to yourdomain.com

// You can use frames to mask your address bar so it always shows www.yourdomain.com when viewing your pages. Use the frameset below in your default page (index.htm). In this example, the frameset will load home.htm and start your site from there. But the address bar will stay showing www.yourdomain.com.

<frameset rows="*">
<frame src="home.htm">
frameset> 

Disable autocomplete on input fields

// Disable autocomplete on any input field with the "autocomplete" parameter in your input tag

<input name="first_name" type="text" autocomplete="off">

Disable right click

// added to diable the right click.. works on *most* browsers

<body oncontextmenu="return false">

Disable IE image toolbar

// Place in the to get rid of the IE image toolbar

<meta http-equiv="imagetoolbar" content="no">

avoid visible whitespace in html

// if you want a line break and want to indent your html code
// but the browser makes problems with the whitespace
// make the whitespace a comment

//example
<div id="topimages">
        <image class="left" src="image/left.jpg"><image class="left" src="image/mid.jpg"><image class="right" src="image/right.jpg">
div>

Find All Elements By Class

// Javascript function that will return an array of elements based on DOM element, tag, and class name.
// For instance, getElementsByClassName(document, 'tr', 'INFO') will get all "tr" tags under the document node with the "INFO" class and return an array of them.

function getElementsByClassName(oElm, strTagName, strClassName){
var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
            var arrReturnElements = new Array();
            strClassName = strClassName.replace(/\-/g, "\\-");
            var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
            var oElement;
            for(var i=0; i<arrElements.length; i++){
                oElement = arrElements[i];
                if(oRegExp.test(oElement.className)){
                    arrReturnElements.push(oElement);
                }
            }
            return (arrReturnElements)
        }

Fix IE 5.5 and IE 6 PNG transparency problem

Include this javascript to make PNG 24 bit transparencies work properly in IE 5.5 and 6


center text in html

// center horizontally
// text-align:center for internet explorer, margin:auto for firefox

<div style="text-align:center">
  <div style="margin:auto">the textdiv>
</div>


// center vertically with table
<table><tr><td valign="middle">the texttd></tr>table>


// or without table (only firefox, .. / not in internet explorer <=6!)
<div style="display:table-cell;        vertical-align: middle">the textdiv>

Country dropdown HTML

<select>
<option value="AF">Afghanistanoption>
/option>
<option value="AL">Albaniaoption>
/option>
<option value="AS">American Samoaoption>
/option>
<option value="AO">Angolaoption>
/option>
<option value="AQ">Antarcticaoption>
/option>
<option value="AR">Argentinaoption>
/option>
<option value="AW">Arubaoption>
/option>
<option value="AT">Austriaoption>
/option>
<option value="BS">Bahamasoption>
/option>
<option value="BD">Bangladeshoption>
/option>
<option value="BY">Belarusoption>
/option>
<option value="BZ">Belizeoption>
/option>
<option value="BM">Bermudaoption>
/option>
<option value="BO">Boliviaoption>
/option>
<option value="BW">Botswanaoption>
/option>
<option value="BR">Braziloption>
/option>
<option value="BN">Brunei Darussalamoption>
/option>
<option value="BF">Burkina Fasooption>
/option>
<option value="KH">Cambodiaoption>
/option>
<option value="CA">Canadaoption>
/option>
<option value="KY">Cayman Islandsoption>
/option>
<option value="TD">Chadoption>
/option>
<option value="CN">Chinaoption>
/option>
<option value="CC">Cocos (Keeling) Islandsoption>
/option>
<option value="KM">Comorosoption>
/option>
<option value="CD">Congo, The Democratic Republic Of Theoption>
/option>
<option value="CR">Costa Ricaoption>
/option>
<option value="HR">Croatiaoption>
/option>
<option value="CY">Cyprusoption>
/option>
<option value="DK">Denmarkoption>
/option>
<option value="DM">Dominicaoption>
/option>
<option value="EC">Ecuadoroption>
/option>
<option value="SV">El Salvadoroption>
/option>
<option value="ER">Eritreaoption>
/option>
<option value="ET">Ethiopiaoption>
/option>
<option value="FO">Faroe Islandsoption>
/option>
<option value="FI">Finlandoption>
/option>
<option value="GF">French Guianaoption>
/option>
<option value="TF">French Southern Territoriesoption>
/option>
<option value="GM">Gambiaoption>
/option>
<option value="DE">Germanyoption>
/option>
<option value="GI">Gibraltaroption>
/option>
<option value="GL">Greenlandoption>
/option>
<option value="GP">Guadeloupeoption>
/option>
<option value="GT">Guatemalaoption>
/option>
<option value="GN">Guineaoption>
/option>
<option value="GY">Guyanaoption>
/option>
<option value="HM">Heard Island And Mcdonald Islandsoption>
/option>
<option value="HN">Hondurasoption>
/option>
<option value="HU">Hungaryoption>
/option>
<option value="IN">Indiaoption>
/option>
<option value="IR">Iran, Islamic Republic Ofoption>
/option>
<option value="IE">Irelandoption>
/option>
<option value="IL">Israeloption>
/option>
<option value="JM">Jamaicaoption>
/option>
<option value="JE">Jerseyoption>
/option>
<option value="KZ">Kazakhstanoption>
/option>
<option value="KI">Kiribatioption>
/option>
<option value="KR">Korea, Republic Ofoption>
/option>
<option value="KG">Kyrgyzstanoption>
/option>
<option value="LV">Latviaoption>
/option>
<option value="LS">Lesothooption>
/option>
<option value="LY">Libyan Arab Jamahiriyaoption>
/option>
<option value="LT">Lithuaniaoption>
/option>
<option value="MO">Macaooption>
/option>
<option value="MG">Madagascaroption>
/option>
<option value="MY">Malaysiaoption>
/option>
<option value="ML">Malioption>
/option>
<option value="MH">Marshall Islandsoption>
/option>
<option value="MR">Mauritaniaoption>
/option>
<option value="YT">Mayotteoption>
/option>
<option value="FM">Micronesia, Federated States Ofoption>
/option>
<option value="MC">Monacooption>
/option>
<option value="MS">Montserratoption>
/option>
<option value="MZ">Mozambiqueoption>
/option>
<option value="NA">Namibiaoption>
/option>
<option value="NP">Nepaloption>
/option>
<option value="AN">Netherlands Antillesoption>
/option>
<option value="NZ">New Zealandoption>
/option>
<option value="NE">Nigeroption>
/option>
<option value="NU">Niueoption>
/option>
<option value="MP">Northern Mariana Islandsoption>
/option>
<option value="OM">Omanoption>
/option>
<option value="PW">Palauoption>
/option>
<option value="PA">Panamaoption>
/option>
<option value="PY">Paraguayoption>
/option>
<option value="PH">Philippinesoption>
/option>
<option value="PL">Polandoption>
/option>
<option value="PR">Puerto Ricooption>
/option>
<option value="RE">Reunionoption>
/option>
<option value="RU">Russian Federationoption>
/option>
<option value="SH">Saint Helenaoption>
/option>
<option value="LC">Saint Luciaoption>
/option>
<option value="VC">Saint Vincent And The Grenadinesoption>
/option>
<option value="SM">San Marinooption>
/option>
<option value="SA">Saudi Arabiaoption>
/option>
<option value="CS">Serbia And Montenegrooption>
/option>
<option value="SL">Sierra Leoneoption>
/option>
<option value="SK">Slovakiaoption>
/option>
<option value="SB">Solomon Islandsoption>
/option>
<option value="ZA">South Africaoption>
/option>
<option value="ES">Spainoption>
/option>
<option value="SD">Sudanoption>
/option>
<option value="SJ">Svalbard And Jan Mayenoption>
/option>
<option value="SE">Swedenoption>
/option>
<option value="SY">Syrian Arab Republicoption>
/option>
<option value="TJ">Tajikistanoption>
/option>
<option value="TH">Thailandoption>
/option>
<option value="TG">Togooption>
/option>
<option value="TO">Tongaoption>
/option>
<option value="TN">Tunisiaoption>
/option>
<option value="TM">Turkmenistanoption>
/option>
<option value="TV">Tuvaluoption>
/option>
<option value="UA">Ukraineoption>
/option>
<option value="GB">United Kingdomoption>
/option>
<option value="UM">United States Minor Outlying Islandsoption>
/option>
<option value="UZ">Uzbekistanoption>
/option>
<option value="VE">Venezuelaoption>
/option>
<option value="VG">Virgin Islands, Britishoption>
/option>
<option value="WF">Wallis And Futunaoption>
/option>
<option value="YE">Yemenoption>
/option>
<option value="ZW">Zimbabweoption>
</select>

50 states dropdown HTML

<select name="state">
<option value="">Pick your stateoption>
/option>
<option value="AK">Alaskaoption>
/option>
<option value="AR">Arkansasoption>
/option>
<option value="CO">Coloradooption>
/option>
<option value="DE">Delawareoption>
/option>
<option value="FL">Floridaoption>
/option>
<option value="HI">Hawaiioption>
/option>
<option value="IL">Illinoisoption>
/option>
<option value="IA">Iowaoption>
/option>
<option value="KY">Kentuckyoption>
/option>
<option value="ME">Maineoption>
/option>
<option value="MA">Massachusettsoption>
/option>
<option value="MN">Minnesotaoption>
/option>
<option value="MO">Missourioption>
/option>
<option value="NE">Nebraskaoption>
/option>
<option value="NH">New Hampshireoption>
/option>
<option value="NM">New Mexicooption>
/option>
<option value="NC">North Carolinaoption>
/option>
<option value="OH">Ohiooption>
/option>
<option value="OR">Oregonoption>
/option>
<option value="RI">Rhode Islandoption>
/option>
<option value="SD">South Dakotaoption>
/option>
<option value="TX">Texasoption>
/option>
<option value="VT">Vermontoption>
/option>
<option value="WA">Washingtonoption>
/option>
<option value="WI">Wisconsinoption>
/option>
select>

Center something vert. and horz. in a web page using CSS

Here's how to center anything vertically and horizontally in a web page using CSS. Works with most all browsers that support CSS.

I adapted this from Jak psåt web, thanks!

<html>
        <head>
                <title>Center w/ CSStitle>
                
        
        
                
"outer">
"middle">
"inner"> your stuff here in center of page

add website to geourl

//add website to geourl
//long desciption on http://geourl.org/add.html

#1 get coordinates

#2 add meta tags to head
<meta name="ICBM" content="XXX.XXXXX, YYY.YYYYY">
<meta name="DC.title" content="THE NAME OF YOUR SITE">

#3 ping http://geourl.org/ping/

Disable a checkbox

Disable a checkbox via HTML or javascript.

<INPUT TYPE="checkbox" NAME="MyCheckbox" VALUE="Select Me" DISABLED>

document.forms[0].MyCheckbox.disabled = false;

Check / Uncheck all checkboxes in a pseudo group

This bit of javascript will check and uncheck all checkboxes in a group of checkboxes. The checkboxes are grouped by naming all the checkboxes by the same name.

Javascript Code:
function checkUncheckAll(checkAllState, cbGroup)
{
        // Check that the group has more than one element
        if(cbGroup.length > 0)
        {
                // Loop through the array
                for (i = 0; i < cbGroup.length; i++)
                {
                        cbGroup[i].checked = checkAllState.checked;
                }
        }
        else
        {
                // Single element so not an array
                cbGroup.checked = checkAllState.checked;
        }
}


HTML Code:
<input type=checkbox name=checkall onclick="checkUncheckAll(this, grp1);">
<input type=checkbox name=grp1 id=bx1>
<input type=checkbox name=grp1 id=bx2>
<input type=checkbox name=grp1 id=bx3>
<input type=checkbox name=grp1 id=bx4>

Strip html tags

The regex below removes html tags from string (untested).

str = <<HTML_TEXT



  

Application error

Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html

HTML_TEXT puts str.gsub(/<\/?[^>]*>/, "")

Disable selecting text in HTML with javascript events

When you need to diable selection of text in a page use the following events in the wrapping tag. This is useful if you use javascript ondblclick and don't want the text to be selected.

onmousedown will stop the selection in Firefox. IE will still select text though so you must also use onselectstart to keep IE from selecting the text.

<td onmousedown="return false;" onselectstart="return false;">

HTML tag stripper

// *UNTESTED*
// Strips complete and incomplete HTML tags from $html

function strip_bad_tags($html)
{
   $s = preg_replace ("@]*>*@", "", $html);
   return $s;
}
« Newer Snippets
Older Snippets »
27 total  XML / RSS feed