Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: What Happened to My CSS?

  1. #1
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    259
    Thanks
    92
    Thanked 3 Times in 3 Posts

    Default What Happened to My CSS?

    Slide show on https://www.njgunlawyers.com/page.php?here=FID consists of eight images. Each of the eight has its own css parameters (all identical). The css is being ignored. Most obvious is absence of border on any of the eight.

    Can y'all help me?

    A.
    Last edited by marain; 10-12-2020 at 04:36 PM. Reason: Mark "Resolved"

  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,687
    Thanks
    1
    Thanked 252 Times in 247 Posts

    Default

    Hi there marain,


    first of all remove all of this inline CSS nonsense...

    Code:
    
     style="margin-top:12px; margin-bottom:8px; border-color:black; border-width:8px; border-style:solid; "
    ...from the HTML.

    Then open your njgunlawyers.css file, go to line #16 and change this...

    Code:
    
    #slide {
        height: 191px; /* adjust this value to suit your taste */
        width: auto;
     }
    ...to this...

    Code:
    
    #slide {
        height: 191px; /* adjust this value to suit your taste */
        width: auto;
        margin: 12px auto 8px; 
        border: 8px solid black;
     }

    coothead
    ~ the original bald headed old fart ~

  3. #3
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    259
    Thanks
    92
    Thanked 3 Times in 3 Posts

    Default

    Coothead,

    Your suggestion is, oh, so much more elegant than my nonsense. That's the good news. The bad news is it still does not work.

    A.

  4. #4
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,687
    Thanks
    1
    Thanked 252 Times in 247 Posts

    Default

    Hi there marain,

    The bad news is it still does not work.

    You probably know what I am going to say to that assertion.

    You have a cache problem.

    As you were having difficulties clearing it, I did post, in
    another thread of yours, a drastic solution for you to try...

    http://www.dynamicdrive.com/forums/s...574#post330574

    coothead
    ~ the original bald headed old fart ~

  5. The Following User Says Thank You to coothead For This Useful Post:

    marain (10-12-2020)

  6. #5
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    259
    Thanks
    92
    Thanked 3 Times in 3 Posts

    Default

    Coothead,

    Clearing cache works. Thank you.

    (But I do not understand why my inline css, inelegant as it was, failed.)

    A.

  7. #6
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,687
    Thanks
    1
    Thanked 252 Times in 247 Posts

    Default

    Quote Originally Posted by marain View Post
    "But I do not understand why my inline css, inelegant as it was, failed."

    The code was simply misplaced.

    it needed to set for this element...

    Code:
     
    <img id="slide" src="images/fid310x191.jpg" alt="" class="center">
    ...rather than all these...

    Code:
     
    <img src="images/fid147x191.jpg" width="156" height="191" alt=" ">
    <img src="images/fid156x191.jpg" width="156" height="191" alt=" ">
    <img src="images/fid178x191.jpg" width="341" height="191" alt=" ">
    <img src="images/fid236x191.jpg" width="236" height="191" alt=" ">
    <img src="images/fid284x191.jpg" width="236" height="191" alt=" ">
    <img src="images/fid287x191.jpg" width="287" height="191" alt=" ">
    <img src="images/fid310x191.jpg" width="310" height="191" alt=" ">
    <img src="images/fid341x191.jpg" width="341" height="191" alt=" ">

    coothead
    ~ the original bald headed old fart ~

  8. The Following User Says Thank You to coothead For This Useful Post:

    marain (10-12-2020)

  9. #7
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    259
    Thanks
    92
    Thanked 3 Times in 3 Posts

    Default

    Coothead,

    I thanked you before, and I thank you again. But I continue to profess bepuzzlement over why specifying css information inline at the elementary level fails. https://www.w3schools.com/Css/css_howto.asp leads me to believe my inline css, ineligent as it is, should work. It doesn't. Your method does. I bow to reality.

    I've trespassed enough on your time. Please do not feel obliged to respond.

    A.

  10. #8
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,687
    Thanks
    1
    Thanked 252 Times in 247 Posts

    Default

    Hi there morain,

    let's clear up this misunderstanding.

    It seems that you thought that my reply implied that inline CSS would
    not work for your problem.
    That is not the case. it would have worked had you had just applied
    it to the correct HTML element.

    Instead of my writing...

    "first of all remove all of this inline CSS nonsense.["
    ...I should have pointed out to you that the use of inline CSS is
    actually considered to be bad practice and should be removed
    where possible.

    What it does do, is override any external CSS that may have
    been applied to the element in question. You can test this for
    yourself by adding...
    Code:
     style="border: 8px dotted red"
    ...to this...
    Code:
    <img id="slide" src="images/fid310x191.jpg" alt="" class="center">
    You will see that you image now has a dotted red border
    instead of a solid black one.

    Further reading:-

    Avoid using inline styling

    I trust that this will help clear up any confusion that I may have
    caused.

    coothead
    ~ the original bald headed old fart ~

  11. #9
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    259
    Thanks
    92
    Thanked 3 Times in 3 Posts

    Default

    Coothead,

    Thanks.

    I'll reply privately.

    Best,

    A.

  12. #10
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,687
    Thanks
    1
    Thanked 252 Times in 247 Posts

    Default


    Quote Originally Posted by greenconcept View Post
    The styles you added to each image only work on block elements.;
    This is not true.

    Code:
    
    img {
        border: 0.5em solid #000;
     }
    I would suggest the you test the above code.
    It will confirm my assertion.

    coothead
    ~ the original bald headed old fart ~

Similar Threads

  1. something very odd happened
    By Johnnymushio in forum HTML
    Replies: 1
    Last Post: 04-27-2010, 04:59 AM
  2. What happened to the so-called hacker?
    By tech_support in forum The lounge
    Replies: 6
    Last Post: 07-31-2006, 09:13 AM

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
  •