HighDots Forums  

CSS style won't work?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss CSS style won't work? in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dmh5
 
Posts: n/a

Default CSS style won't work? - 11-10-2004 , 11:31 PM






I have been trying all night to get my CSS style to work with no success. I've
never had this problem before. The style is a tile that I want to use as the
page expands downward. I have created the style, chose the cell in my table,
and applied the style from the style menu. The problem is: The style works
within Dreamweaver when the page needs to expand, but when I preview in IE the
tile isn't there. I don't know what to do. Anyone else had this problem? Any
advice? Thanks


Reply With Quote
  #2  
Old   
Gary White
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 12:17 AM






"dmh5" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I have been trying all night to get my CSS style to work with no success.
I've
never had this problem before. The style is a tile that I want to use as
the
page expands downward. I have created the style, chose the cell in my
table,
and applied the style from the style menu. The problem is: The style works
within Dreamweaver when the page needs to expand, but when I preview in IE
the
tile isn't there. I don't know what to do. Anyone else had this problem?
Any
advice? Thanks

The answer is in the code. Can you upload it and post a link so someone can
take a look?

Gary




Reply With Quote
  #3  
Old   
kreatiivne
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 02:43 AM



dmh5 wrote:

Quote:
background-image: url(/assets/images/layout_r14_c1.jpg);

img src="../assets/images/layout_r2_c1.jpg" width="779" height="64" border="0"
Compare the two different paths and You see where Your problem is. DW
understands the root related path, but Your browser doesn't (the one in
the style).

--
Margus
http://devil.pri.ee/


Reply With Quote
  #4  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 07:21 AM



The problem is two-fold.

1. You have used a root relative link for the stylesheet.
2. You have disabled the use of temp files in preview (EDIT | Preferences >
Preview in Browser)

The former is NOT a problem if you have not also done the latter. The
reason is this. When you allow DW to use temp files, it automatically
rewrites all root relative to document relative links and builds this temp
file, which it them hands to the browser for preview. If you don't allow
temp files, then you don't get the rewrite. When the browser sees the
leading "/", it goes to the root of the hard drive to look for the path, and
that obviously fails.

To read more about this, go here -

http://www.macromedia.com/support/dreamweaver/ts/documents/site_root_rel.htm
http://www.macromedia.com/support/dreamweaver/ts/documents/document_vs_site.htm


--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"kreatiivne" <devil@-no-spam-hvc.ee> wrote

Quote:
dmh5 wrote:

background-image: url(/assets/images/layout_r14_c1.jpg);

img src="../assets/images/layout_r2_c1.jpg" width="779" height="64"
border="0"

Compare the two different paths and You see where Your problem is. DW
understands the root related path, but Your browser doesn't (the one in
the style).

--
Margus
http://devil.pri.ee/



Reply With Quote
  #5  
Old   
dmh5
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 09:13 AM



Thanks guys, I'll give it a try. Hopefully I can fix the problem. If not, I'll be back here ; )

Reply With Quote
  #6  
Old   
Gary White
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 09:43 AM



dmh5 wrote:

Quote:
I don't have any where to upload right now. I could use the attach code for
this forum but I don't know if it will be too large for everyone's liking.

While the other comments are valid, they will not fix your problem. You
have created a CSS class, as evidenced by this code:

<style type="text/css">
<!--
..lefttile {
background-color: #FFFFFF;
background-image: url(/assets/images/layout_r14_c1.jpg);
}
-->
</style>


You have NOT, however, applied that class to anything. To make it work,
first fix the path as others have suggested. Then you'll need to click
inside the area that you want the background applied to. To apply the
class, right click on the tag in the quick tag selector that you want to
apply it to, choose Set Class and then lefttile from the menu.


Gary


Reply With Quote
  #7  
Old   
dmh5
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 11:02 AM



I think I tried what was suggested, and it did show up correctly in preview
after going to the preferences and enabling use of temp files. But when
uploaded it didn't work. There was a gap and then the style showed up towards
the bottom. I read the links that were given but still don't understand the
scope of my problem. I think I kind of see what is being said but not sure how
to fix it. Can some one possibly give an example to the correction? Gary wrote
that I had created the style but had not applied the style. I had already done
what he suggested and given his inquiry I went to check the code and make sure
and this is what I found: <td><img src='assets/images/layout_r13_c1.jpg'
alt='' name='layout_r13_c1' width='120' height='140' border='0'
class='lefttile'></td> Is this right? It looks like the class has been
applied. I still can't understand what is going on. I have used tiles alot and
never ran into this problem. I'm not sure if it is the style that is the
problem or my table setup. I have a row with two columns. The left colum has
two rows. Within the top row of the left column is another table that contains
my navigation. In the bottom row of the left column I have an image. I want to
apply the style to the bottom row so that when I add content to the right
column, it expands accordingly with the style repeating. I'm not sure if this
is part of the problem or not, just thought I would add some extra info.


Reply With Quote
  #8  
Old   
Gary White
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 01:04 PM



dmh5 wrote:

Quote:
and this is what I found: <td><img src='assets/images/layout_r13_c1.jpg'
alt='' name='layout_r13_c1' width='120' height='140' border='0'
class='lefttile'></td> Is this right?

Yes. The "class='lefttile' was not in the uploaded version I saw. Now
you just need to fix the path.


Gary


Reply With Quote
  #9  
Old   
dmh5
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 03:09 PM



The path within where the style is defined or where it is later used? And what portion of the path do I fix?

Reply With Quote
  #10  
Old   
Gary White
 
Posts: n/a

Default Re: CSS style won't work? - 11-11-2004 , 07:09 PM



dmh5 wrote:

Quote:
The path within where the style is defined or where it is later used?
And what portion of the path do I fix?
See the links that Murray posted:
http://www.macromedia.com/support/dreamweaver/ts/documents/site_root_rel.htm
http://www.macromedia.com/support/dreamweaver/ts/documents/document_vs_site.htm


Gary


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.