View Full Version : What is wrong with this?!
Penguin_Otaku 04-19-2004, 11:54 PM body -background-color:#ede3ca-
p -font-size: 12pt;
color:#604740-
#image1
-
img style=position:absolute;
top:150px;
left:30px;
width:145px;
height:50px
src="welcome.jpg"
---/img-
-
img style="position:absolute;
top:195px;
left:30px;
width:145px;
height:50px" img
src="ra1.jpg"
-
p
-
position: absolute;
top: 150px;
left: 200px
-
This is in an external style sheet I'm using for my website. First I don't know what kind of selectors to use for images, and second I can't seem to put images in the ESS correctly and I can't link my images at all.
kittycat 04-20-2004, 12:43 AM You can't put regular images in CSS, unless you want it as a background of something. If you want to link the image you have to include it in regular HTML.
body { background-color:#ede3ca }
p { font-size: 12pt;
color:#604740 }
#image1
{
position:absolute;
top:150px;
left:30px;
width:145px;
height:50px
}
#image2
{ position:absolute;
top:195px;
left:30px;
width:145px;
height:50px }
p (do you want this to be for all paragraphs or just one/a few? if only one/few you may want to make this a class or id)
{
position: absolute;
top: 150px;
left: 200px }
That's more what your style sheet should look like.
Since you've defined ids for your images, you could just do the tags like this... <img src="image.gif" id="image1"> and that would have the attributes of #image1 in the CSS
Penguin_Otaku 04-20-2004, 01:09 AM Thank you so much! ^^
Penguin_Otaku 04-20-2004, 01:34 AM What's the code to take borders off of images for links?
salomeyasobko 04-20-2004, 01:38 AM a {image-border: none}
:)
salomeyasobko 04-20-2004, 01:45 AM arg that was the wrong code, sorry! :lol:
it's
img a {border: none;}
Penguin_Otaku 04-20-2004, 01:53 AM Thanks yous.
Penguin_Otaku 04-20-2004, 01:56 AM Neither works.
kittycat 04-20-2004, 02:54 AM Try just
img {border: 0; }
Rosey 04-20-2004, 03:00 AM i think it's
a img { border: 0; } if you want just the linked ones off.
Penguin_Otaku 04-20-2004, 04:04 AM Thanks guys. Rosey, hi from Pawnee, Oklahoma.
Rosey 04-20-2004, 04:42 AM no prob, hope it worked from you!
Hi from Tulsa :)
Penguin_Otaku 04-20-2004, 10:49 PM How can I put a limit on how far text goes? Like keepingi t within boundries.
kittycat 04-21-2004, 12:19 AM Add a width to a container, like a P or div.
width: 200px;
Change the value as you need, you could just add the to the P section in your CSS
Penguin_Otaku 04-21-2004, 01:12 AM Thanks again. These board are helpful. Not the quickest replies, but helpful! ^_^
Penguin_Otaku 04-21-2004, 01:38 AM Poo. How do I make a second class for a second paragraph? Like the first one is just "p" and used as "-p-" The - are <. How would I go and ID it? "-id=paragraph-"?
kittycat 04-21-2004, 02:43 AM In the CSS have...
#paragraph1 { attributes }
and in HTML...
<p id="paragraph1">
Penguin_Otaku 04-21-2004, 05:15 AM Sorry, another Q. Can you indent?!
Calidris 04-21-2004, 07:59 AM Yup.
You can use text-indent: 1em to indent the first line or margin-left: 1em (or padding-left) to indent the whole block.
Or you could use tables, lolol.
Penguin_Otaku 04-21-2004, 07:59 PM Gah. I can't figure it out. What's wrong?
body { background-color:#efe3ca }
p {
font-size: 12pt;
color:#604740}
p
{
text-indent: 1cm
}
A:link {text-decoration:none; }
A:visited {text-decoration:none; }
a img { border: 0; }
#image1
{
position:absolute;
top:150px;
left:30px;
width:145px;
height:50px
}
#image2
{
position:absolute;
top:195px;
left:30px;
width:145px;
height:50px
}
#image3
{
position:absolute;
top:240px;
left:30px;
width:145px;
height:50px
}
#image4
{
position:absolute;
top:285px;
left:30px;
width:145px;
height:50px
}
#image5
{
position:absolute;
top:330px;
left:30px;
width:145px;
height:50px
}
#para1
{
position: absolute;
top: 155px;
left: 200px;
width: 525px
}
#para2
{
position: absolute;
top: 150px;
left: 760px;
}
#para2
{
text-indent: 1cm
}
Rosey 04-21-2004, 09:28 PM what part isn't working? I think you can use cm for the indent but i would use px instead.
I wouldn't separate them like on your #para2
#para2
{
position: absolute;
top: 150px;
left: 760px;
text-indent: 50px
}
Penguin_Otaku 04-21-2004, 10:07 PM How can I just indent a certain part of the text?
Calidris 04-21-2004, 10:41 PM That depends which part of the text you want to indent. E.g. mid-paragraph, start of a paragraph, end of a paragraph etc. More details needed :)
Penguin_Otaku 04-21-2004, 11:30 PM The beginning of each paragraph. Like.. this.
*INDENT HERE*BLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHB LAHBLAH
BLAHBLAH---
*INDENT HERE* BLAHBLAH
BLAHBLAHBLAH
Calidris 04-22-2004, 12:17 AM The style rule p { text-indent: 20px; } will indent the first line of the paragraph by 20 pixels. To apply the same rule to a specific paragraph you would do the folllowing:
<style type="text/css">
#para2 { text-indent: 20px; }
</style>
<p id="para2">My text</p>
Since it is likely you want to indent more than one paragraph, you would probably use a class rather than an id:
<style type="text/css">
.indent { text-indent: 20px; }
</style>
<p class="indent">My text</p>
<p class="indent">My text</p>
Does that help?
Penguin_Otaku 04-22-2004, 01:15 AM It does, but I'm using an external style sheet. And I added that code and used it, and it worked, but now it doesn't have any of the other attributes I gave it.
kittycat 04-22-2004, 03:03 AM You can give a paragraph both an ID and CLASS (I think) try it like this to see if it works...
<p id="para2" class="indent">
Penguin_Otaku 04-22-2004, 04:14 AM Does work, but overlaps since it puts it at the same coords, twice.
Calidris 04-22-2004, 07:59 AM I think it's time to bring in an example link.
I imagine your CSS is slightly wrong or you've given two elements the same ID (which is invalid as ID's are unique).
Penguin_Otaku 04-22-2004, 12:51 PM The ID says to position 150 px down from the top, k?
This is an ex.
<p id=para1>BLAHBLAH<p id=para1 class=indent>
Calidris 04-22-2004, 07:05 PM You HTML should be looking more like this:
<style type="text/css">
.indent { text-indent: 20px; }
</style>
<p id="para1">BLAHBLAH</p>
<p id="para2" class="indent">BLAH BLAH</p>
<p id="para3>BLAH BLAH</p>
Only the 2nd paragraph will be indented.
Remember that you should always close HTML elements and you shouldn't put <p> tags inside <p> tags :)
Penguin_Otaku 04-23-2004, 10:44 PM Given up on indenting. I've seen that most sites don't even do it and no one takes it as poor grammar. Anyway, now I'm trying to change my link color(s). I used the code from Lissa's site and took off the <...css> whatever at the top and put it in my ESS. Still nothing.
Rosey 04-23-2004, 10:52 PM link please
Penguin_Otaku 04-23-2004, 11:06 PM body { background-color:#efe3ca }
p
{
font-size: 12pt;
color:#604740
}
body
{
body {
scrollbar-3dlight-color: #efe3ca;
scrollbar-arrow-color: #000000;
scrollbar-base-color: #efe3ca;
scrollbar-darkshadow-color: #000000;
scrollbar-face-color: #FFFFFF;
scrollbar-highlight-color: #efe3ca;
scrollbar-shadow-color: #efe3ca;
scrollbar-track-color: #efe3ca;
}
.indent { text-indent: 20px; }
A:link { text-decoration: none; color:#604740; }
A:visited { text-decoration: none; color:#604740; }
A:hover { text-decoration: none; color:#efe3ca; }
a img { border: 0; }
#image1
{
position:absolute;
top:150px;
left:30px;
width:145px;
height:50px
}
#image2
{
position:absolute;
top:195px;
left:30px;
width:145px;
height:50px
}
#image3
{
position:absolute;
top:240px;
left:30px;
width:145px;
height:50px
}
#image4
{
position:absolute;
top:285px;
left:30px;
width:145px;
height:50px
}
#image5
{
position:absolute;
top:330px;
left:30px;
width:145px;
height:50px
}
#para1
{
position: absolute;
top: 155px;
left: 200px;
width: 525px
}
#para2
{
position: absolute;
top: 150px;
left: 760px;
width: 140px
}
Rosey 04-23-2004, 11:12 PM This part:
body { background-color:#efe3ca }
p
{
font-size: 12pt;
color:#604740
}
body
{
body {
scrollbar-3dlight-color: #efe3ca;
scrollbar-arrow-color: #000000;
scrollbar-base-color: #efe3ca;
scrollbar-darkshadow-color: #000000;
scrollbar-face-color: #FFFFFF;
scrollbar-highlight-color: #efe3ca;
scrollbar-shadow-color: #efe3ca;
scrollbar-track-color: #efe3ca;
}
should be
p
{
font-size: 12pt;
color:#604740
}
body {
background-color:#efe3ca;
scrollbar-3dlight-color: #efe3ca;
scrollbar-arrow-color: #000000;
scrollbar-base-color: #efe3ca;
scrollbar-darkshadow-color: #000000;
scrollbar-face-color: #FFFFFF;
scrollbar-highlight-color: #efe3ca;
scrollbar-shadow-color: #efe3ca;
scrollbar-track-color: #efe3ca;
}
Penguin_Otaku 04-23-2004, 11:19 PM Thanks, but I'm asking about the link part.
Calidris 04-23-2004, 11:31 PM In your CSS, you've got all of the "styles" of links colored... except the default style
Your code:A:link { text-decoration: none; color:#604740; }
A:visited { text-decoration: none; color:#604740; }
A:hover { text-decoration: none; color:#efe3ca; }
Try adding this:
a { text-decoration: none; color:#ff0000; }
And regarding the indenting: starting with the introduction of word processors on computers it's very rarely done. This includes typed letters and e-mails. It's pretty much a standard now to not use them :)
Rosey 04-23-2004, 11:34 PM i know you were talking about your links but if you screw up on your css and add extra opening { the rest of it will likely not work. Fix it and see. If it doesn't work, i'd like an actual link to see if there is anything else that isn't the problem
Penguin_Otaku 04-23-2004, 11:35 PM Yea, I've realized that about indenting. I just don't like having mistakes and you know, indenting just seems to be a habit with all the reports I've done this year in school.
Penguin_Otaku 04-23-2004, 11:43 PM That worked. THANK YOU.
|