Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-14-2010, 10:27 PM   #11
Daemon Poster
 
Join Date: May 2009
Posts: 690
Default Re: css code help

ok say I have some text

This Is My Site.

Now I want make the text move into the page 100 pixals and come down 100 pixale.

I would type this

<div stile="position:absolute;top:100px;left:100px;">
This Is My Site.
</div>

this lets me put the text anywere on the page I want.


Now if I want to make the background line on my page I type this

<div stile="background:black;width:50px;hight:50px;"></div>

but you say none of thie is css so if I am right then css only goes in the head tags???
__________________

biferi is offline   Reply With Quote
Old 03-15-2010, 12:21 AM   #12
In Runtime
 
Disenchanterx's Avatar
 
Join Date: Mar 2010
Posts: 164
Default Re: css code help

Style not Stile

css can go into tags as well....... its called inline

A <div> tag is XHTML this allows you to do "divisions" of content on the page. You however can add css attributes to your XHTML tags.

There are three ways to apply css. You have been mixing up the three ways.

Examples of code similar to what your wanting.

<div style="position: absolute; top: 100px; left: 100px;">
This Is My Site.
</div>

<div style="background-color: #000000; color: #ffffff; width: 200px; hight: 200px;">
this is black background
</div>

Edit: I'm sorry if I'm confusing you. Just to try make this simple.

If the css attributes are included in a <div> tag or a <span> tag etc. it is referred to as inline CSS. (this is normally not a preferred method).

If the css attributes are located in the header section of the html file and are contained between the <style></style> tags. This is normally referred to as embedded CSS (good for when you only have a few HTML files)

If the css attributes are stored in an external file called something.css separate from the html file. The HTML files will have a <link /> tag to instruct the browser to look at the external style sheet. (this method is preferable when dealing with multiple pages)
__________________

__________________
M.C.S.E.
Minesweeper Consultant / Solitaire Expert
Disenchanterx is offline   Reply With Quote
Old 03-15-2010, 11:03 AM   #13
Daemon Poster
 
Join Date: May 2009
Posts: 690
Default Re: css code help

thank you for all your help I have been reading up on all the diferant <DiV> tags
So <div> is not css but you can usee css code in <div> Tags ok.

But what is the <div> tag for then???

Like the <div> tags I showed you were to place an abject on the page by telling it how many pixals to move.

I get this so to me <div> Tags let you have more controle over things.

am I right but they are not css
biferi is offline   Reply With Quote
Old 03-15-2010, 02:19 PM   #14
In Runtime
 
Disenchanterx's Avatar
 
Join Date: Mar 2010
Posts: 164
Default Re: css code help

Yes, a <div> tag gives you control of where things are displayed and positioned on a web page.

Think of the <div> tags as a block. We are going to take all of the content that is on the web page an put it in blocks. We can use these blocks of different sizes and shapes that contain all the content to control and alter the display of the website.

Now when the webpage is built these blocks can be arranged and stacked in multiple ways and configurations to display the website in anyway that the designer prefers.
__________________
M.C.S.E.
Minesweeper Consultant / Solitaire Expert
Disenchanterx is offline   Reply With Quote
Old 03-15-2010, 02:31 PM   #15
Daemon Poster
 
Join Date: May 2009
Posts: 690
Default Re: css code help

Can you show me in your own word how to make the master page that will controle all the text on every page you have?

Like if I have a Table on a web page and in every Cell I have text but I have no Font Tags around it.

I can let it be and have a master css page tell every page how to set the font.

Can you tell me how or is there a web site that will just tell me this one thing
biferi is offline   Reply With Quote
Old 03-15-2010, 03:04 PM   #16
In Runtime
 
Disenchanterx's Avatar
 
Join Date: Mar 2010
Posts: 164
Default Re: css code help

Yeah, I can do that.

OMG, this is gonna be a damn long post. I just finished watching Hackers on TV so thats where i got the content at


Okay copy and paste this text into note pad and save it as index.html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
<title>Hacker's Manifesto</title>
<link href="hacker.css" rel="stylesheet" type="text/css" />
</head>



<body>
<div id="container">
<div id="title">
\/\The Conscience of a Hacker/\/
</div>
<div id="author">
by +++The Mentor+++
</div>
<div id="date">
Written on January 8, 1986
</div>
<br/>
<br/>
Another one got caught today, it's all over the papers. <br/>"Teenager Arrested in Computer Crime Scandal",<br/> "Hacker Arrested after Bank Tampering"... Damn kids. They're all alike.<br/>
<br/>
But did you, in your three-piece psychology and 1950's technobrain,<br/>ever take a look behind the eyes of the hacker? Did you ever wonder what made him tick, <br/>what forces shaped him, what may have molded him? I am a hacker, enter my world...<br/>
<br/>
Mine is a world that begins with school...<br/>I'm smarter than most of the other kids,<br/>this crap they teach us bores me... Damn underachiever. They're all alike.<br/>
<br/>
I'm in junior high or high school. <br/> I've listened to teachers explain for the fifteenth time how to reduce a fraction. <br/> I understand it. "No, Ms. Smith, I didn't show my work. <br/> I did it in my head..." Damn kid. <br/>Probably copied it. They're all alike.<br/>
<br/>
I made a discovery today. <br/>I found a computer. Wait a second, this is cool. <br/> It does what I want it to. If it makes a mistake, it's because I screwed it up. <br/> Not because it doesn't like me... Or feels threatened by me... <br/>Or thinks I'm a smart ass...<br/> Or doesn't like teaching and shouldn't be here... Damn kid. <br/> All he does is play games. They're all alike.<br/>
<br/>
And then it happened... a door opened to a world... <br/>rushing through the phone line like heroin through an addict's veins, <br/>an electronic pulse is sent out, <br/>a refuge from the day-to-day incompetencies is sought... a board is found.<br/> "This is it... this is where I belong..." I know everyone here...<br/> even if I've never met them, never talked to them, may never hear from them again... <br/>I know you all... Damn kid. <br/>Tying up the phone line again. They're all alike...<br/>
<br/>
You bet your ass we're all alike...<br/> we've been spoon-fed baby food at school when we hungered for steak... <br/>the bits of meat that you did let slip through were pre-chewed and tasteless. <br/>We've been dominated by sadists, or ignored by the apathetic. <br/>The few that had something to teach found us will-ing pupils, <br/>but those few are like drops of water in the desert.<br/>
<br/>
This is our world now... the world of the electron and the switch, the beauty of the baud. <br/> We make use of a service already existing without paying for what could be dirt-cheap<br/> if it wasn't run by profiteering gluttons, and you call us criminals. <br/> We explore... and you call us criminals. <br/> We seek after knowledge... and you call us criminals. <br/> We exist without skin color, without nationality, without religious bias... <band you call us criminals. <br/>You build atomic bombs, you wage wars, you murder, cheat, and lie to us <br/>and try to make us believe it's for our own good, yet we're the criminals.<br/>
<br/>
Yes, I am a criminal. My crime is that of curiosity. <br/> My crime is that of judging people by what they say and think, not what they look like.<br/> My crime is that of outsmarting you, something that you will never forgive me for.<br/>
<br/>
I am a hacker, and this is my manifesto.<br/> You may stop this individual, but you can't stop us all... <br/>after all, we're all alike.<br/>
<br/>

<div id="author">
+++The Mentor+++
</div>


</body>
</div>
</html>


Okay copy and paste this text into note pad and save it as hacker.css

body { background-color: #339933;
color: #000000;
}
#container { margin-left: auto;
margin-right: auto;
width:75%;
border: 4px groove;
background-color: #66FF00;
color: #000000;
text-align:center;
}
#title { background-color:#66FF00;
color:#000000;
font-weight: bold;
font-size:1.2em;
}
#author{ background-color:#66FF00;
color:#ff0000;
font-size:.8em;
}
#date{ background-color:#66FF00;
color:#000000;
font-size:.8em;
border-bottom: 4px groove;
}


Make sure both files are in the same folder


It will look something like this
__________________

__________________
M.C.S.E.
Minesweeper Consultant / Solitaire Expert
Disenchanterx is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:09 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0