SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css not working properly

    i have created a css file & a html file

    if i am using the css from the root directory as the html page its displayed properly
    <link href="styles.css" rel="stylesheet" type="text/css" />

    but if i put the css file in a folder
    <link href="CSS/styles.css" rel="stylesheet" type="text/css" />
    few of the style are not applied to the page

    i need to use the same css with the same layout as of HTML page in .aspx page VS2008
    but when i use it
    <link href="styles.css" rel="stylesheet" type="text/css" />
    the whole contents are messed out
    the arrangenment of the elemnts are lost

    how do i rectify

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,296
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by svibuk View Post
    i have created a css file & a html file

    if i am using the css from the root directory as the html page its displayed properly
    <link href="styles.css" rel="stylesheet" type="text/css" />

    but if i put the css file in a folder
    <link href="CSS/styles.css" rel="stylesheet" type="text/css" />
    few of the style are not applied to the page
    What do you mean by a few of the styles are not applied?

    If some of them are being applied then you must have linked to the file correctly because it would be all or nothing.

    Or do you just have some missing background images which is probably because the path to the images would have changed if you have just dumped the css in another directory?

  3. #3
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think u r right reg the background images used in CSS will check it out

    the main imp issue is usig css with .net ie with .aspx file

    wh am i not getting the desired layout

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,296
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Css and html in a sense have nothing to do with how the page was constructed serverside as all we are interested in is what the browser sees. All we need to know about is what you see from "View source" after the page has landed on the browser.

    If you view the resulting code above you will see where the css files are linked to and you can check if the path is correct by following them.

    If on the other hand you are talking about how to construct asp pages (how to include files in asp etc) then I'll move the thread to the asp forum as that is a different subject altogether.

  5. #5
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i dont want to know how to construct a dot net page

    i just want to implement the .css in aspx page

    i hvae linked the external css created in the dotnet page
    this is teh same css which i have used in HTML page

    even the layout of both HTML page & dotnet page is same
    as i have copied the whole HTML tags from html page to the dotnet page insid ethe body tag
    but still as i said the matter & the contents in teh dot net page is messed up


    i hope u understand my issue

    or is there a better way i culd explain

    in practical there shld not be any change as i have copied the whole body from HTML page to teh dotnet page as it is , still its creating a problem
    hope u culd help

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,296
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Do you have the site live so that we could see it somewhere?

    Or perhaps posts 2 screenshot showing the two different displays that you are getting. Then run both pages and from view source copy the code from both pages and paste in here.

    Without full html and css we are just guessing. It could be something as simple as you not having a doctype in one page or a typo somewhere.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •