CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Recent Posts

Pages: [1] 2 3 ... 10
1
Our specialists monitor changes in the immigration
laws of countries in order to quickly apply new
opportunities that have opened up or, conversely,
avoid legal inconsistencies that may lead to refusal.

citizenship movie lesbian
2
Our specialists monitor changes in the immigration
laws of countries in order to quickly apply new
opportunities that have opened up or, conversely,
avoid legal inconsistencies that may lead to refusal.

moldova ardolino anal
3
Our specialists monitor changes in the immigration
laws of countries in order to quickly apply new
opportunities that have opened up or, conversely,
avoid legal inconsistencies that may lead to refusal.

moldova ukcanfree sex sites
4
Our specialists monitor changes in the immigration
laws of countries in order to quickly apply new
opportunities that have opened up or, conversely,
avoid legal inconsistencies that may lead to refusal.

visa 18 and abused
5
HTML / CSS / Re: Making a gallery what is wrong?
« Last post by Jason Knight on 2 Aug 2020, 08:59:42 pm »
Well, you've got three problems. One I've already explained to you in that you've got "classes for nothing" AND non-semantic markup. The other is that you're trying to work in pixels, AND trying to use positioning for what I think should be transform:scale's job.  It's a newer property that I'm not too surprised you don't know yet.

First let's fix the markup. A gallery like this is a list of choices. As such it goes into a UL with LI just like how you'd write a menu. If we wrap ALL the content in an anchor we can hook that for the style and still have legacy browser support if you care,

YES, anchors around block level tags USED[/b] to be invalid. HTML 5 changed that rule. I'm not 100% kosher with that, but here it doesn't matter, you don't need block level tags inside it.

Because honestly, I doubt you have enough text for each of these to be a paragraph, and P is kind of redundant inside proper line-items in situations like this.

To that end, gut the markup down to:

Code: [Select]
<ul id="gallery">
<li>
<a href="images/gallery/test_full.jpg">
<img
src="images/gallery/test_thumb.jpg"
alt="describe this image, ALT IS NOT OPTIONAL"
>
Some text describing the image
</a>
</li><li>
<a href="images/gallery/test2_full.jpg">
<img
src="images/gallery/test2_thumb.jpg"
alt="describe this image, ALT IS NOT OPTIONAL"
>
Some text describing the image
</a>
</li><li>
<a href="images/gallery/test_full.jpg">
<img
src="images/gallery/test_thumb.jpg"
alt="describe this image, ALT IS NOT OPTIONAL"
>
Some text describing the image
</a>
</li><li>
<a href="images/gallery/test_full.jpg">
<img
src="images/gallery/test_thumb.jpg"
alt="describe this image, ALT IS NOT OPTIONAL"
>
Some text describing the image
</a>
</li><li>
<a href="images/gallery/test_full.jpg">
<img
src="images/gallery/test_thumb.jpg"
alt="describe this image, ALT IS NOT OPTIONAL"
>
Some text describing the image
</a>
</li><li>
<a href="images/gallery/test_full.jpg">
<img
src="images/gallery/test_thumb.jpg"
alt="describe this image, ALT IS NOT OPTIONAL"
>
Some text describing the image
</a>
</li>
</ul>

Note the inclusion of ALT and the removal of all the P and "classes for nothing".

To get them to have equal height so that the floats don't ride up funky, the new "flex" layout is probably a safe bet, though you could also use inline-block instead of the floats. Depends on what else you're planning for styling here. Just beware that if you go with flex, IE9 and earlier won't have columns.

Assuming a reset is in use and everything is set to box-sizing:border-box, the CSS would go something like this:

Code: [Select]
#gallery {
list-style:none;
display:flex;
flex-wrap:wrap;
justify-content:center;
max-width:48em;
margin:0 auto;
}

#gallery a {
display:block;
max-width:12em;
vertical-align:top;
padding:1em;
}

#gallery img {
display:block;
width:100%;
height:auto;
margin:0 auto 1em;
transition:transform 0.5s;
}


#gallery a:focus img,
#gallery a:hover img {
transform:scale(1.25);
}

Remember -- as I told you last week -- to set :focus in addition to :hover so that keyboard navigation isn't left out in the cold. Don't worry, you'll start remembering these little details given time.

Also notice how I converted to using EM. With box-sizing set a 12em max-width minus the 1EM internal padding gives you 10em, which at normal font-size is 160px. This makes the thumbnails dynamic so that users like myself on 4k displays can get them larger without diving for the zoom. Remember what I said? Use EM whenever you can? Well, use 'em!

To that end between dynamic scaling and high res displays, I'd probably "bite the bullet" and use 2x resolution thumbs, so 320px wide. A bit bandwidth heavy, but that could probably be helped by using JPEG or even WEBP instead of PNG. Really the best image format for each thumb in "production" should be tested with the best format chosen.

Here's a live demo I tossed together for you:

https://cutcodedown.com/for_others/JesseWillWreckYa/gallery/

The nice part of using flex here is that flex-wrap:wrap and the use of max-widths means it's already "responsive" without even resorting to media queries. Flex says that all containers inside it scale to share box-edges. With flex-wrap and a max-width on the children and a max width on the container, it will all auto-flow to fit.

And transform:scale means you don't have to play games width setting the width or positioning.  The 1.25 scale for hover I came up with by just dividing the 160px you had by the 200px hover.

NOT too complicated once you gut out all the unnecessary doo-dads.

That about what you're looking for?
6
HTML / CSS / Re: Making a gallery what is wrong?
« Last post by JesseWillWreckYa on 2 Aug 2020, 08:11:26 pm »
Forgot too. How I make the hover change the image when the text or area around the image is hovered?
7
HTML / CSS / Making a gallery what is wrong?
« Last post by JesseWillWreckYa on 2 Aug 2020, 08:06:05 pm »
My sister wants a image gallery on her site, thought I knew what I was doing but now I'm lost.

The gallery should have 4 images across at desktop, but they're not fitting right. The hover should also enlarge them but I can only figure out how to do it for the x axis since they're all different aspects. How do I get the bottom two to not ride up all funny and the containers to match?

I have this code:

<div id="gallery">
   <div class="galleryCard">
      <a href="images/gallery/test_full.png">
         <img src="images/gallery/test_thumb.png" class="gelleryImage">
      </a>
      <p class="galleryText">
         <a href="#>Some text describing the image</a>
      </p>
   </div>
   <div class="galleryCard">
      <a href="images/gallery/test_full.png">
         <img src="images/gallery/test_thumb.png" class="gelleryImage">
      </a>
      <p class="galleryText">
         <a href="#>Some text describing the image</a>
      </p>
   </div>
   <div class="galleryCard">
      <a href="images/gallery/test_full.png">
         <img src="images/gallery/test_thumb.png" class="gelleryImage">
      </a>
      <p class="galleryText">
         <a href="#>Some text describing the image</a>
      </p>
   </div>
</div>

and this:

.galleryCard {
   float:left;
   width:25%;
}

.galleryImage,
.galleryText {
   margin:1em;
}

.galleryImage {
   position:relative;
   width:160px;
   height:auto;
   margin:1em;
   transition:all 0.5s;
}

.galleryImage:hover {
   width:200px;
   left:-20px;
}
8
Introductions / Re: Holla Holla
« Last post by mmerlinn on 2 Aug 2020, 02:52:22 pm »
Yes, a book is needed, but if Jason is spending all of his time putting out arsonist's fires, he will never have time to finish it.
9
Introductions / Re: Holla Holla
« Last post by benanamen on 2 Aug 2020, 12:59:49 pm »
Jason write a book or some online guides

I would like to see this book as well. I highly encourage you to finish it. Even if it gets "out of date" by the time you finish, it will still be decades ahead of what is out there. I am especially interested in Accessibility.
10
Introductions / Re: Holla Holla
« Last post by Jason Knight on 2 Aug 2020, 03:15:46 am »
I believe I said "The web is for everyone, not just the perfectly able bodied", but yeah. that.

It's a message today's narcissistic sociopaths seem to be ready to fight tooth and nail.

... and if I came in gruff, it's because I'm always fighting people at these types of contracts who got themselves in trouble, but then refuse to admit wrongdoing. Or to admit bad choices. And in cases -- like this one -- who fight against actually fixing things.

Generally it's the guys at the top, but I encounter it across the board in general.

Hell, I screwed up when it came to tying in the USGS data and one of your co-workers pointed it out. What did I do? I admitted I was wrong, and we fixed it. If the same thing happened with your ex-boss, he'd have doubled down "no that's right" and deployed it.

Which is why that map API you folks were using had that strange 90 degree rotate in the code none of you could explain. I copied what he had done server-side for data processing without that client-side rotate. He had basically layered more code on top to fix that he got longitude and latitude backwards. Hence when I used the same data order, the maps were wrong.

What was it Patton said? "I know I'm a primadonna! I admit it! That's what I can't stand about Monty, he won't admit it."

Rather than track down that the server-side code was backwards, he just threw more code at the client-side to fix it... and did so in a painfully convoluted way at that. I honestly don't think he even understood how any of the server-side code he was using (that he clearly didn't write) worked and -- like so many others -- was just blindly copying other people's work with zero understanding.

YOU understood it better, and that's not even your job! That part where you explained the JOIN I couldn't even wrap my brain around? Perfect example. That such a complex join was even in place for static data that only gets updated once a month -- on EVERY page request? Ouch.

You missed the conniption fit he threw over that code being changed. A change that reduced server load what, 60%?
Pages: [1] 2 3 ... 10

Advertisement