Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

Setting Up Css File


  • Please log in to reply
15 replies to this topic

#1 Ziggy

Ziggy

    HR 2

  • Active Members
  • PipPip
  • 28 posts

Posted 13 February 2005 - 11:09 PM

I'm trying to set up a CSS style sheet with this coding

CODE
<style>
#ScrollDiv {
width:425px;
height:130px;
overflow: auto;
background-color: #E3E1DD;
border-color: #CCCCCC #666666 #666666 #CCCCCC;
border: 1px solid;
}
</style>

<STYLE type=text/css>
A:link {
    COLOR: blue; FONT-WEIGHT: none; TEXT-DECORATION: none
}
A:hover {
    COLOR: red; FONT-WEIGHT: none; TEXT-DECORATION: underline
</STYLE>


I have this on the pages, but would rather be able to edit it through just one file. Cansomebody please show me how I would set this code up in a css stylesheet.
Thanks
Ziggy

PS Do search engines have problems spidering a scrolable div? Do they have anything against it?
Thanks
Ziggy

#2 maleman

maleman

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 677 posts

Posted 14 February 2005 - 12:18 AM

hey zig,

I never heard of "font-weight: none". Probably you meant "font-weight: normal" or "font-weight: bold".

Unless you have a CSS Editor, to set up your external stylesheet just copy and past your styles into Notepad and save the file as "whatever.css"

Unless you have a CSS Editor, to edit it, you'll have to change the .css extension to "whatever.txt" and then back to "whatever.css" when you're done editing.

Also, forget about the tags <style> and </style> along with the comment marks inside them, they're not needed in your external stylesheet.

I don't forsee any probs with a scrollable <div>. I'd want to take a look at the finished product before making a final judjment.

Put that file in whatever directory you want to put it in, I always put in the directory where my pages that use it are located if possible.

Use this to call the stylesheet into your html file, the "href="whatever.css" is assuming you have the stylesheet in the same directory:

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

Put it in the <head> section of your html file.

When you do use <style> tags, do it like this:

<style type="text/css">
<!--

.whatever { blah: yadda; ipso: facto; hey: now; }

-->
</style>

There's some posts around here about CSS. If you search CSS, you could find them and maybe pick up something.

Edited by maleman, 14 February 2005 - 12:52 AM.


#3 Ron Carnell

Ron Carnell

    HR 6

  • Moderator
  • 959 posts
  • Location:Michigan USA

Posted 14 February 2005 - 02:05 PM

QUOTE
Unless you have a CSS Editor, to edit it, you'll have to change the .css extension to "whatever.txt" and then back to "whatever.css" when you're done editing.

Quick Tip: Save yourself a step when using a text editor by enclosing the file name in quotes when initially saving.

You're right, if you type whatever.css as the file name, most text editors will save the file as whatever.css.txt (automatically adding the .txt extension), thus forcing you to rename the file. However, in every text editor I've ever tested, if you type "whatever.css" (with the quotes), the editor will save it as intended and eliminate the renaming step.

#4 sweepthelegnate

sweepthelegnate

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 903 posts
  • Location:Dallas, Texas

Posted 14 February 2005 - 02:07 PM

or if you save it with "all files" selected from the drop down menu instead of "text file" which forces the .txt extension it will save as a css file.

#5 Jill

Jill

    High Rankings Advisor

  • Admin
  • 32,316 posts

Posted 14 February 2005 - 02:19 PM

Ooooo good tips guys!

#6 Raphael

Raphael

    The Limey Cowboy

  • Active Members
  • PipPipPipPipPipPip
  • 722 posts
  • Location:New England

Posted 14 February 2005 - 02:39 PM

And most text editors won't care what the extension is when you pull it back up to re-edit it, if you drag and drop the file. Who uses the file -> open command these days anyway?

#7 Jill

Jill

    High Rankings Advisor

  • Admin
  • 32,316 posts

Posted 14 February 2005 - 02:43 PM

QUOTE
Who uses the file -> open command these days anyway?


<raises hand>

#8 Raphael

Raphael

    The Limey Cowboy

  • Active Members
  • PipPipPipPipPipPip
  • 722 posts
  • Location:New England

Posted 14 February 2005 - 02:45 PM

*grins*

Actually, my wife does, too. In everything. Even things like WinAmp. I'm a drag-and-drop man, myself... Or a double-click on the filename man.. but then my wife never uses Windows explorer for anything, either, whereas I use it for everything.

For me, navigating through windows explorer to find a file is significantly easier than navigating through the little file select box that comes up with open -> file. Different folks, different strokes, I guess.

That said...... If you name your stylesheet whatever.css then in order to open it in a basic text editor you will have to select the 'show all files' option. That will bring up a list of all the files in that directory, not just the ones that have the extension that the editor likes. However, your text editor will still read a file that has a .css extension.

Remember, whether a program can read a file or not is not necessarily based on it's file extension. The file extension is mostly there to guide us humans as to what type of file it is, but if you drag and drop a text file into a text editor, the editor will display it without complaint, regardless of what extension the file may have =)

Edited by Raphael, 14 February 2005 - 02:52 PM.


#9 sweepthelegnate

sweepthelegnate

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 903 posts
  • Location:Dallas, Texas

Posted 14 February 2005 - 03:05 PM

personally...I'm a "right click open with notepad" kind of guy when it come to .css and .htm extensions...

#10 Raphael

Raphael

    The Limey Cowboy

  • Active Members
  • PipPipPipPipPipPip
  • 722 posts
  • Location:New England

Posted 14 February 2005 - 03:30 PM

QUOTE(sweepthelegnate @ Feb 14 2005, 04:05 PM)
personally...I'm a "right click open with notepad" kind of guy when it come to .css and .htm extensions...
View Post

Right click, open with is good =)

Quick tip, for those who don't know. If you're using Win2K, you can hold down the SHIFT key as you right click, and windows will ask you which application to open the file with. You can either select one from the list it provides, or you can browse your directory structure and pick an application executable.

#11 maleman

maleman

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 677 posts

Posted 14 February 2005 - 05:17 PM

I use a program called Top Style that came with Dreamweaver for CSS

Since I don't have a PHP editor, I use Notepad when I'm screwing around with the code in a PHP file.

I rightClick the .php file and choose "Rename" and change the extension to .txt and then open it with Notepad. When I'm finished, I save it and close it. I then rightClick it again and choose "Rename" and change it back to .php extension.

You can do the same with CSS files and other files too that are text-based.

I learned not to use Wordpad for editing html documents. I did it before and the encoding type would be changed and the file wouldn't validate as 4.01 html. I guess it's because Wordpad documents are formatted text.

It took me a while to figure out that the encoding was why it wasn't validating.
thumbup1.gif

#12 leadegroot

leadegroot

    Lea de Groot

  • Active Members
  • PipPipPipPipPip
  • 488 posts
  • Location:Brisbane, Australia

Posted 14 February 2005 - 08:16 PM

If in doubt, run your css through the validator at http://jigsaw.w3.org/css-validator/
A good way to clear out errors that are driving you crazy smile.gif

#13 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 14 February 2005 - 09:19 PM

Personally I simply have .css files associated with my HTML-Kit, so that even if I pull one from a web site that's where it opens. All formatted to fit on my screen and with color coding. wink.gif

#14 sweepthelegnate

sweepthelegnate

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 903 posts
  • Location:Dallas, Texas

Posted 14 February 2005 - 09:43 PM

QUOTE
Personally I simply have .css files associated with my HTML-Kit


I like html kit, but that extra 3 seconds over notepad it takes to open seems like an eternity to me...

#15 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 15 February 2005 - 07:48 AM

hysterical.gif I just have it open all the time Nathan. So I get no delay.

Is that a sad commentary or what? I honestly don't remember the last time I used notepad. But it's been years at this point.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users