Skip to content

Commit

Permalink
h4: add p>a>img
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Reagle committed Aug 25, 2012
1 parent a4734ea commit f32463b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
7 changes: 6 additions & 1 deletion class.dzslides
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ $endfor$
border: 1px solid #e0e0e0;
}

/********************** Images **************************/
/* An image in a multi-element slide are floated to either side for variety */
section:nth-child(odd) > a:not(:only-child) > img,
section:nth-child(odd) > p:not(:only-child) > img {
Expand All @@ -196,6 +197,7 @@ $endfor$
/* border: 2px solid green; */
}


/* Center lone (hypertexted) images*/
section > p:last-child > img:only-child,
section > a:last-child > img:only-child,
Expand All @@ -219,6 +221,7 @@ $endfor$
/* border: 6px solid orange; */
}


/* Figures are displayed full-page, with the caption
on top of the image/video */
figure {
Expand Down Expand Up @@ -248,6 +251,7 @@ $endfor$
width: 80%;
}


/* Instead of using the caption, we can also use h4 as the overlay text */
h4 {
top: 480px;
Expand All @@ -261,7 +265,8 @@ $endfor$
}
/* Center h4s lone (hypertexted) image*/
h4 + p:last-child img:only-child,
h4 + a:last-child > img:only-child {
h4 + a:last-child > img:only-child,
h4 + p:last-child > a:only-child > img:only-child {
float: none;
/* 750px is needed to keep centered given parent <p>'s margins */
max-width: 750px; max-height: 600px;
Expand Down
22 changes: 16 additions & 6 deletions template.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,14 @@ <h1>WikiCommons photo</h1>
</section>
<section class="slide level1" id="section-8">

<a title="By Sasan Geranmehr (Own work) [CC-BY-3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons" href="http://commons.wikimedia.org/wiki/File%3APersian_Cat_(kitten).jpg"><img width="256" alt="Persian Cat (kitten)" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Persian_Cat_%28kitten%29.jpg/256px-Persian_Cat_%28kitten%29.jpg"/></a>
</section>
<section class="slide level1" id="section-9">

<h4 id="using-h4-w-400600">Using h4 w/ 400/600</h4>
<p><img src="http://placekitten.com/g/400/600" alt="kitten 400/600"> </p>
</section>
<section class="slide level1" id="section-9">
<section class="slide level1" id="section-10">

<h4 id="using-h4-w-1200800">Using h4 w/ 1200/800</h4>
<p><img src="http://placekitten.com/g/1200/800" alt="kitten 1200/800"> </p>
Expand All @@ -147,19 +151,19 @@ <h4 id="using-h4-w-1200800">Using h4 w/ 1200/800</h4>
<h1>Do you agree with the cultural imperialism thesis?</h1>
<p><a href="http://commons.wikimedia.org/wiki/File%3AQuestion_mark_alternate.svg" title="By User:Stannered [Public domain], via Wikimedia Commons"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/Question_mark_alternate.svg/256px-Question_mark_alternate.svg.png" alt="Question"></a></p>
</section>
<section class="slide level1" id="section-10">
<section class="slide level1" id="section-11">

<h2 id="video">Video</h2>
</section>
<section class="slide level1" id="section-11">
<section class="slide level1" id="section-12">

<figure> <!-- Videos are automatically played -->

<video src="http://videos-cdn.mozilla.net/brand/Mozilla_Firefox_Manifesto_v0.2_640.webm" poster="http://www.mozilla.org/images/about/poster.jpg"></video> <figcaption>A video</figcaption>
</figure>

</section>
<section class="slide level1" id="section-12">
<section class="slide level1" id="section-13">

<iframe width="560" height="315" src="http://www.youtube.com/embed/mzPxo7Y6JyA" frameborder="0" allowfullscreen></iframe>
</section>
Expand Down Expand Up @@ -302,6 +306,7 @@ <h1>End!</h1>
border: 1px solid #e0e0e0;
}

/********************** Images **************************/
/* An image in a multi-element slide are floated to either side for variety */
section:nth-child(odd) > a:not(:only-child) > img,
section:nth-child(odd) > p:not(:only-child) > img {
Expand All @@ -320,9 +325,11 @@ <h1>End!</h1>
/* border: 2px solid green; */
}


/* Center lone (hypertexted) images*/
section > p:last-child > img:only-child,
section > a:last-child > img:only-child {
section > a:last-child > img:only-child,
section > p:last-child > a:only-child > img:only-child {
display: block;
margin-left: auto;
margin-right: auto;
Expand All @@ -342,6 +349,7 @@ <h1>End!</h1>
/* border: 6px solid orange; */
}


/* Figures are displayed full-page, with the caption
on top of the image/video */
figure {
Expand Down Expand Up @@ -385,11 +393,13 @@ <h1>End!</h1>
}
/* Center h4s lone (hypertexted) image*/
h4 + p:last-child img:only-child,
h4 + a:last-child > img:only-child {
h4 + a:last-child > img:only-child,
h4 + p:last-child > a:only-child > img:only-child {
float: none;
/* 750px is needed to keep centered given parent <p>'s margins */
max-width: 750px; max-height: 600px;
margin-left: auto; margin-right: auto;
/* border: 8px solid red; */
}

/* Footer */
Expand Down
4 changes: 4 additions & 0 deletions template.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor

<a title="By Sasan Geranmehr (Own work) [CC-BY-3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons" href="http://commons.wikimedia.org/wiki/File%3APersian_Cat_(kitten).jpg"><img width="256" alt="Persian Cat (kitten)" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Persian_Cat_%28kitten%29.jpg/256px-Persian_Cat_%28kitten%29.jpg"/></a>

---------

<a title="By Sasan Geranmehr (Own work) [CC-BY-3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons" href="http://commons.wikimedia.org/wiki/File%3APersian_Cat_(kitten).jpg"><img width="256" alt="Persian Cat (kitten)" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Persian_Cat_%28kitten%29.jpg/256px-Persian_Cat_%28kitten%29.jpg"/></a>

--------

#### Using h4 w/ 400/600
Expand Down

0 comments on commit f32463b

Please sign in to comment.