how to organize html image sources for future content changes - html

I have a certain number of images into the html, and each one is accompanied with some text and/or transitions. Each set of img and whatever else (text, video, etc...) is inside a div to allow and simplify positioning. Also, each image is numbered as in a magazine or a book. Lets say for the shake of argument that there are 30 pages.
Then from the art dept, I receive a new page, which will be the fourth page, displacing the following ones one page further. Also, for organization porpouses, the img files also are renamed (i.e. img-20-jpeg now is img-21-jpeg)
Im looking for a way to avoid renaming manually classes of each div, img, paragraph, both in html and css.
I have tried to ignore actual numbers in img sources and refer the css styling to each "page" by nth-child selector.
Also, I have tried to relate each set of text, effects, etc... to it's inmediate "page" parent with ~.
so far, i have succeded only in epic headaches.
<div class="page">
<img class="page" src="photo/img.001.jpeg" alt="1">
<p class="text-page-1">
some text
</p>
</div>
<img class="page" src="photo/img.002.jpeg" alt="2">
<img class="page" src="photo/img.003.jpeg" alt="3">
<div class="page">
<img class="page" src="photo/img.004.jpeg" alt="4">
<video class= "video-page-4" src="video/4.mov" controls playsinline loop></video>
</div>
<div class="page">
<img class="page" src="photo/img.005.jpeg" alt="5">
<p class="text-page-5">
some other text
</p>
</div>

A couple ideas.
avoid numbering; use comments to keep track. also change the hard-coded classes like text-page-1 to get a paragraph inside of class page: .page p or .page > p.
<!--page 1-->
<div class="page">
<img src="photo/img.001.jpeg" alt="1">
<p>
some text
</p>
</div>
<!--page 2-->
<div class="page">
<img src="photo/img.0045.jpeg" alt="1">
<p>
some text
</p>
</div>
use old-school numbering. start at 10 and go up by 10, or even 100.
that way you can do inserts without renumbering everything.
<div class="page">
<img src="photo/img.10.jpeg" alt="1"> <!--start at 10.-->
<p class="text-page-10"> <!--use class only if necessary-->
some text
</p>
</div>
<!--can insert a new page here using numbers 11-19.-->
<div class="page">
<img src="photo/img.20.jpeg" alt="1">
<p class="text-page-20">
some text
</p>
</div>

You can use this code
<!--page 1-->
<div class="page">
<img class="page" src="photo/images/img1.jpeg" alt="1">
<p class="text-page-1">some text</p>
</div>
<!--page 2-->
<div class="page">
<img class="page" src="photo/images/img2.jpeg" alt="2">
<img class="page" src="photo/images/img3.jpeg" alt="3">
</div>
<!--page 3-->
<div class="page">
<img class="page" src="photo/images/img4.jpeg" alt="4">
<video class= "video-page-4" src="video/4.mov" controls playsinline loop></video>
</div>
<!--page 4-->
<div class="page">
<img class="page" src="photo/images/img5.jpeg" alt="5">
<p class="text-page-5">some other text</p>
</div>

Related

Is there a way to have a right fixed image not break the line on the left side?

Is there a way to align images to the right side of the screen without having a line break on the other side in HTML/CSS? I have tried to figure this out, but the methods I tried (absolute position, not using float) either did not do anything, or made the element go away entirely. Could someone tell me how to accomplish this?
<body>
<p class="title"><img src="pkd.png" class="logo"></p>
<h1>Hello!</h1>
<div class="wrap">
stuff on here:
<img src="bb.png">
<img src="ab.png">
<img src="rb.png">
</div>
<p>Welcome to PolyKD! This site is still under construction , so there's not much yet .</p>
<p> But what there is you can find over to your right .</p>
<p>Have a nice day! <img src="pippin.png"></p>
</body>
Looks like:
This.
I want it to look like: This.
Thanks!
You may try to use positioning,
<body>
<p class="title">
<img src="pkd.png" class="logo">
</p>
<h1>Hello!</h1>
<div class="wrap">
stuff on here:
<img src="bb.png">
<img src="ab.png">
<img src="rb.png">
</div>
<div style="position:relative">
<p>Welcome to PolyKD! This site is still under construction , so there's not much yet .</p>
<p> But what there is you can find over to your right .</p>
<p>Have a nice day!</p>
<img src="pippin.png" style="position:absolute; right:0;">
</div>
</body>
Nesting divs should help:
<p class="title"><img src="pkd.png" class="logo"></p>
<h1>Hello!</h1>
<div>
<div align=left width="80%" style="float:left">
<p>Welcome to PolyKD! This site is still under construction , so there's not much yet .</p>
<p> But what there is you can find over to your right .</p>
<p>Have a nice day! <img src="pippin.png"></p>
</div>
<div align=right class="wrap" width="20%" style="float:right">
stuff on here:<br/>
<img src="bb.png"><br/>
<img src="ab.png"><br/>
<img src="rb.png">
</div>
</div>

Put img on the border of two divs

I would like to place my logo on the border of two divs. I've two questions:
In which div should I place this logo: in div above or in div below or maybe put in another div?
How can I position it. I tried absolute and relative but it doesn't work.
It should looks like:
HTML
<!-- Favorites -->
<section class="favorites">
<h2 class="favorites-header">Urban Favorites</h2>
<div class="favorites-box">
<img src="img/burger-craft-burgers-e1497746930767.png">
<div class="favorites-info">
<h2>Craft Your Own Burger</h2>
<p>Always get exactly what you want with this build-your-own classic. Always get exactly what you want with this build-your-own classic.</p>
</div>
</div>
<div class="favorites-box-last">
<img src="img/burger-craft-fries.jpg">
<div class="favorites-info">
<h2>Loaded Cheese Fries</h2>
<p>Always get exactly what you want with this build-your-own classic. Always get exactly what you want with this build-your-own classic.</p>
</div>
</div>
<!-- Here is my logo --> <img class="favorites-logo" src="img/urban8-logo-shadow.png" alt="logo-shadow">
</section>
<!-- Review -->
<section class="review">
<div class="review-element">
<p>"Great meals!"</p>
<img src="img/five-stars.png">
<p>-Jane Doe</p>
</div>
<div class="review-element">
<p>"Awesome atmosphere!"</p>
<img src="img/five-stars.png">
<p>-Aicia Fox</p>
</div>
<div class="review-element">
<p>"Everything is ok"</p>
<img src="img/five-stars.png">
<p>-Cesar Algir</p>
</div>
<button>Leave a Review</button>
</section>

CSS and <a href> issue

I have a rollover effect over an image which can be seen here: http://www.sdimmigrationlawyers.com/ (bottom of page - deportation image)
I want to add a link to it, but my tag isn't working. How should I implement it to (1) have the rollover effect, and (2) have the link?
CSS:
<div class="view view-sixth">
<img class="alignleft wp-image-335 size-full" alt="" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg">
<a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense">
<div class="mask"></div>
</a>
<p>
</p>
<div class="content">
<h2>Deportation Defense</h2>
</div>
</div>
HTML:
<div class="paragraph_dui_crime_box2">
<h2>San Diego Deportation Lawyer</h2>
<div class="view view-sixth">
<img class="alignleft wp-image-335 size-full" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg" alt="" />
<a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense">
<div class="mask"></div>
</a>
<div class="content">
<h2>Deportation Defense</h2>
</div>
</div>
You could try wrapping the <a> tag around the whole section like so :
<a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense">
<img class="alignleft wp-image-335 size-full" alt="" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg">
<div class="mask"></div>
<p>
</p>
<div class="content">
<h2>Deportation Defense</h2>
</div>
</a>
Your code with the headline "CSS" is HTML, so I assume it's what's the HTML-code of your page.
If you haven't any restrictions in HTML-markup, do the following and make sure that the DIV with the h2 is wrapped in an anchor leading somewhere:
<a href="...">
<div class="content"><h2>Deportation Defense</h2></div>
</a>
Currently, your anchor surrounds something with no content (that is not clickable), the content on the other side is not properly wrapped in an anchor (so it's neither clickable).

How make teasers appear upon an image and not behind

I have two sections -> hero and teaser, and in the teaser section i need make the teasers pictures appear just a bit upon the hero section, but z-index, position relative and top -1 is not working, i believe this is happening because i am using overflow: hidden, i already try use z-index but is not working.
The code is a bit extensive, so i create a codepen.
This is what i want:
This is what is happening:
I cant use CSS3, just 2, unfortunately..
HTML:
<section class="hero">
</section>
<section class="teasers">
<div class="container">
<div class="teaser">
<img class="teaser__image" src="public/images/main/teasers/pubcrawl.jpg" />
<div class="teaser__content">
</div>
</div>
<div class="teaser">
<img class="teaser__image" src="public/images/main/teasers/diversao.jpg" />
<div class="teaser__content">
</div>
</div>
<div class="teaser">
<img class="teaser__image" src="public/images/main/teasers/crawlers.jpg" />
<div class="teaser__content">
</div>
</div>
<div class="teaser">
<img class="teaser__image" src="public/images/main/teasers/staff.jpg" />
<div class="teaser__content">
</p>
</div>
</div>
</div>
</section>
Your .container has a style of overflow:hidden if you remove that you can see the overflow...
Updated codepen: http://codepen.io/anon/pen/JoBgER

Div won't resize vertically to fit the text. No position:relative or anything like that

My main body div won't resize to fit my text.
My setup is a main body container div. In that div there is the header div, the body div and the footer div. In the body div there are 3 divs called body-left, body-middle and body-right. These are all side by side using the css style float:left
I have tried setting the height of the bodycontainer, the min-height of bodycontainer, and the same for the divs in bodycontainer.
here is a screenshot of whats happening: http://i.imgur.com/6dYRf.jpg
Here is my html:
<div id="maincontainer">
<div id="headercontainer">
<div id="header-logo"></div>
<div id="header-navbar">
<div id="navbar" align="center">
<div>Home</div>
<div>Roster</div>
<div>FAQ</div>
<div>Donate</div>
<div>About</div>
<div>Contact</div>
</div>
</div>
</div>
<div id="bodycontainer">
<div id="body-left">
<ul>
<div>
<a href="http://www.facebook.com/darkonyxftw" title="Click to go to our Facebook page." target="_blank">
<div class="social-odd">
<h3 class="social">Facebook</h3>
<p class="social">All tweets and youtube uploads, as well as updates and notifications go on our facebook. Like our page to get the notifications on your wall.
</p>
<p class="social">facebook.com/DarkOnyxFTW</p>
</div>
</a>
<a href="http://www.youtube.com/subscription_center?add_user=darkonyxftw" title="Click to subscribe to our Youtube channel." target="_blank">
<div class="social-even">
<h3 class="social">Youtube</h3>
<p class="social">Entire practice sessions, special event videos, VODS and casts get uploaded to our youtube channel. click here to subscribe.
</p>
<p class="social">youtube.com/DarkOnyxFTW</p>
</div>
</a>
<a href="http://www.twitter.com/DarkOnyxFTW" title="Click to go to our twitter page." target="_blank">
<div class="social-odd">
<h3 class="social">Twitter</h3>
<p class="social">Everytime we upload a youtube video or our stream goes online on twitch.tv/DarkOnyxFTW, you will know about it if you follow our twitter account.
</p>
<p class="social">twitter.com/DarkOnyxFTW</p>
</div>
</a>
<a href="http://www.twitch.tv/DarkOnyxFTW" title="Click to go to our twitch.tv channel." target="_blank">
<div class="social-even">
<h3 class="social">Live Stream<br># Twitch.tv</h3>
<p class="social">We live stream our practices every Monday, Wednesday and Thursday at 7PM PST (9PM Central). Follow our twitch channel to get an email notification when we go live. We will also be streaming clan battles and other special events, so keep an eye on your inbox for that.
</p>
<p class="social">twitch.tv/DarkOnyxFTW</p>
</div>
</a>
<a href="http://www.teamliquid.net/blog/DarkOnyx" title="Our TeamLiquid Blog" target="_blank">
<div class="social-odd">
<h3 class="social">Team Liquid Blog</h3>
<p class="social">Click here for player interviews, clan war information and much more.
</p>
<p class="social">teamliquid.net/blog/DarkOnyx</p>
</div>
</a>
</div>
</ul>
</div>
<div id="body-middle">
</div>
<div id="body-right">
</div>
</div>
<div id="footercontainer">
<div style="width:590px; padding-left:10px; padding-top:10px;">Site by Alex "Xzar" Mohr</div>
<div id="footer-nav" style="" align="right">
<ul>
<li>About</li> |
<li>Contact</li>
</ul>
</div>
</div>
here is my css: http://darkonyx.webatu.com/style2.css
#bodycontainer{
width:100%;
height:1000px;
background: rgba(0,0,0,0.9);
}
This limits the height to 1000px, which is less than the length of the text.