Centering in a reset...not sure what to do.

Discussion in 'Web Design' started by Kit_Pantelope, Apr 8, 2017.

to remove all ads.
  1. Kit_Pantelope

    Kit_Pantelope New Member

    Messages:
    16
    Hey,

    Need help figuring out how to center the gallery in this project. It's set using a reset css.

    I tried setting it in another div, but to no avail.

    I've attached the file, and here's the link: http://codepen.io/kitteryk_novask/pen/gmNLwg , so whichever you feel like working with.

    Let me know.
     

    Attached Files:

  2. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    To centre align any block level element horizontally, you set it to have a width of less than 100% of the parent and set both side margins to auto.
     
  3. Kit_Pantelope

    Kit_Pantelope New Member

    Messages:
    16
    Noted. When I change the gallery-div to have a width of 99%, it still seems lopsided to the left.

    Why?
     

    Attached Files:

  4. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    Need to se a 'real' URL rather than these code fiddling things.
     
  5. Kit_Pantelope

    Kit_Pantelope New Member

    Messages:
    16
    real talk: this makes it really difficult to be a part of this community because you're the main guy here and most newbs post their stuff on codepen and jsfiddle because no newbs are not working with real urls yet.

    I don't have a url for you - i've posted the file and the link to the codepen. I'll find another person or place to help me out though.
     
  6. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    Which is one of the basic problems today. No one is EVER going to see the layouts in such a set up, they are going to be looking at it served from a normal web server, which is where one's debugging should be done. there are no problem any more that precludes anyone from grabbing a 'free hosting' package as a temporary test bed. Building a reliance on "tools" that may or may not be available at some future time is self defeating and leads one along a route to dependency rather than real debugging skills.

    One can now spend a few dollars on a Raspberry Pi and invest a little time to configure it to run as a web server and you have your own in-house (literally) web server, and if necessary you could forward a port through your home router to allow it to be accessed externally.
     

Share This Page