PDA

View Full Version : would like to create two rules for images


coffee
09-20-2007, 05:04 PM
i would like to create two rules for every image that is placed on every new page i create in dreamweaver cs3. and those two rules are: 0 border and align=left. i'm not very proficient at css so i'm hoping if somebody could tell me a simple (easy to understand) way to implement this.

*background info: i have one folder with about 80 different sites in it that are on the same server. each folder corresponds to a different site that is assigned its own domain name. it's done this way because it's too confusing to create a new site with new ftp info each time there's a new client, and often i have to switch back and forth between folders quickly.

hope somebody can help : (

domedia
09-20-2007, 05:24 PM
1. add a class for all you images
2. I your CSS panel set border to 0 and float to left for that specific CSS class you just assigned to your images.

coffee
09-20-2007, 06:04 PM
thanks for the quick reply.
would this need to be done for every single site folder?
is there no way to alter cs3 preferences so that this becomes the default for all sites?

domedia
09-20-2007, 06:10 PM
It has to be done for every image tag:
<img class="yourClass">
It doesn't matter which folder they're in.
Are you using a server side script to place al the images on your page?
Do you have a url or code you can share?

coffee
09-20-2007, 06:20 PM
basically the sites are created by a bunch of different designers. i download the folder to my computer and add links, banner ads or make graphic changes and then send back to the server. so they are coming in all different ways. each site is different. the cs3 default is to give images a border which means i have to set to zero each time i add a banner ad. i'm just using insert image. however i do create my own sites and when i do that i'd like to set the image class so that every image i add is aligned left so it views properly in firefox. basically i just add tables and insert image slices into the table.

d a v e
09-20-2007, 06:38 PM
instead of using a class why not redefine the img tag?
you could always assign a class with different attributes to any images you *don't* want to include, that way you don't have to go through all the documents assigning classes, just link an external style sheet to each document

domedia
09-20-2007, 07:59 PM
coffee are you familiar with html/css and how to edit them in DW?

coffee
09-21-2007, 02:37 AM
coffee are you familiar with html/css and how to edit them in DW?

yes : )
but mainly the sites i build are just sliced up psd's, video and flash. i'm not sure if it would be a good idea to post urls to the kind of sites i build...
they are "tour sites".
basically i create 9 or 10 psd's, animate some parts, slice em up and add links.

coffee
09-21-2007, 02:43 AM
instead of using a class why not redefine the img tag?
you could always assign a class with different attributes to any images you *don't* want to include, that way you don't have to go through all the documents assigning classes, just link an external style sheet to each document

it's really embarrassing to me that i don't know how to do this.
which is why i've put off trying to figure out how to do it for so long.
*sigh*

d a v e
09-21-2007, 06:32 AM
in a style sheet you could define it as
img {
float:left;
border:0;
}

and then for more on how to make a stylesheet and link it try here
then i was going to point you to the W3C schools css part but it says it's under construction... :(

though there is
http://www.w3.org/Style/CSS/learning

and of course

**** http://www.dreamweaverclub.com/tutorials.php *****

coffee
09-21-2007, 01:09 PM
in a style sheet you could define it as
img {
float:left;
border:0;
}

thanks dave : )
ok so basically all i'd have to do is create an external stylesheet (with what you wrote above) and put it on the main server somewhere and then drop the following code into the head of each site:
<link rel="stylesheet" type="text/css" href="../coffee/style.css" />

the only thing i'm not sure of is where i should put the stylesheet. i don't want to do a separate one for every single site on the server. i guess i could make my own folder and stick it on the server but not sure of the exact root to that would be... anyway does that sound feasible?

my only other concern is that other designers might get pissed that i've put a stylesheet on their site. so i think i'll probably stick to doing the manual changes when i work on other people's sites. but for my own sites i will definitely use the external stylesheet.

d a v e
09-21-2007, 01:30 PM
you can it where you want - either in the root, or in a folder say called 'css' or 'assets' or ... then just link to it whenever you need it.

the float means that the text will wrap around the right and then below the image, btw, in case you were wondering

coffee
09-21-2007, 01:54 PM
yeah i saw it on the link you sent : )
that's going to be useful for the rare occassions i build "normal" websites.
truthfully, if i wasn't having so many problems with firefox line breaks i would probably still be hiding from css. thanks for dragging me out of the stone age lol!

i'm starting to worry that if somebody deletes my folder on the server all these sites will be screwed up. i guess it'd be better to put the stylesheet in with the site.

coffee
09-24-2007, 05:01 PM
ok i'm finding it's just much easier to do this inline.
just by adding


img {
float:left;
border:0;
}


directly onto the page. especially with regards to sites other designers have sent.

but i'm wondering... is there any way in dreamweaver that i can set the preferences for all new pages to automatically have the same code? that way if i just need to make a quick page there would be no need to create an external stylesheet or anything.

domedia
09-24-2007, 05:17 PM
If you use an external style sheet like suggested, all new pages/images would automatically use that style.

coffee
09-24-2007, 05:28 PM
but only the pages on that server. for any other sites i build that are not on that server there would need to be a separate style sheet created. am i looking at this the wrong way? it just seems like (for the type of sites i'm buiding) it would be a lot quicker to just add the code internally. Since all the psds are the same size. after building the first page, all the pages are duped and all i do is search/change the image names (ie. from tour1_01.jpg to tour2_01.jpg, just swap tour1 with tour2) and the page is done.

am i looking at this the wrong way?

domedia
09-24-2007, 05:34 PM
I think so :)
If you ever wanted to change the border on all your images for one site, you would just have to open the stylesheet, edit it and save it and all your HTML pages that use that stylesheet would use the updated style.

Changing the CSS style is better than doing a search and replace, don't you think? Did you ever experience a search/replace go wrong?

coffee
09-26-2007, 02:48 PM
oh yeah i've done search/replace wrong ha! but when that happens all i get is a page full of broken images. not difficult to fix.

also, with the tour sites... once they are done, there's no changes being made. it's not like a real site where a few years down the road you may want to do a total redesign. i don't know if you've ever designed porn, but it's very unfullfilling lol. the site goes up and if it's not making money a few months later it's gone. plus they are only 5-10 pages so if i did, for whatever reason, need to make a slight change it wouldn't be that big of a deal.

ok so i've come to the conclusion that for the tour sites the simplest way to do it is to just add the code into the first page and let it dupe to the other pages as i go. but for a "real" site the best way to do it is external.