:nth-child (odd) not displaying as hoped - html

I have two pages with search results from the Search & Filter plugin, as i don't know how to build the query and loop myself.
http://staging.montra.dk/tilbud & http://staging.montra.dk/events
I want the results to look just like my blocks on the rest of the site; image on one side - text on the other, and then reverse that in the next row. I've successfully managed to display this on every other page than the Search & Filter pages. It's either all images on the left or right, not reversing every other.
I've targeted the div id #artikel on the working pages, but that won't work. Do i need to use some kind of unique id here?
This is my css from the results php;
<section id="post-<? the_ID(); ?>" <? post_class('blok-item'); ?>>
<div class="container-wrap">
<div class="container">
<div id="search-blok" class="row">
<div id="artikel">
<div id="artikel-image" class="col-sm-12 col-md-12 col-lg-6" style="background:linear-gradient( rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.1)), url(<?php the_field( 'intro_billede' ); ?>); background-position: 0% 50%; background-size: cover;"></div>
<div id="artikel-content" class="col-sm-12 col-md-12 col-lg-6">
<div class="hotel-name-artikel">
<?php the_field( 'intro_lille_overskrift' ); ?>
</div>
<div class="artikel-overskrift">
<h2><?php the_title(); ?></h2>
</div>
<div class="artikel-intro">
<?php the_field( 'intro_tekst' ); ?>
</div>
<?php if ( get_field( 'intro_pris' ) ): ?>
<div class="pris-wrapper">
<h2 class="pris">KR. <?php the_field( 'intro_pris' ); ?>,-</h2>
<h4 class="pris-ekstra"><?php the_field( 'intro_pris_extra' ); ?></h4>
</div>
<?php endif ?>
<div class="artikel-link-container">
<?php if ( have_rows( 'links_repeater' ) ) : ?>
<?php while ( have_rows( 'links_repeater' ) ) : the_row(); ?>
<?php $side_intro_repeater_knap_url = get_sub_field( 'side_intro_repeater_knap_url' ); ?>
<?php if ( $side_intro_repeater_knap_url ) { ?>
<a class="<?php the_sub_field( 'repeater_knap_farve' ); ?>" style="float:left" href="<?php echo $side_intro_repeater_knap_url; ?>"><?php the_sub_field( 'repeater_knap_tekst' ); ?></a>
<?php } ?>
<?php endwhile; ?>
<?php else : ?>
<?php // no rows found ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
and the :nth-child css:
artikel:nth-last-child(odd) {
display: -webkit-flex; /* Safari */
-webkit-flex-direction: row-reverse; /* Safari 6.1+ */
display: flex;
flex-direction: row-reverse;
flex-wrap: wrap;
}
Now i'm no wiz at php nor css, so the code might not be precisely as it ought to be, so please bare that in mind :)
Thanks for all help and assistance

I want the results to look just like my blocks on the rest of the
site; image on one side - text on the other, and then reverse that in
the next row.
I'm not entirely sure I understand the question, but if I do, you are definitely on the right track using flex-direction: row and flex-direction: row-reverse.
Working Example:
article {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 600px;
}
article:nth-of-type(even) {
flex-direction: row-reverse;
}
.text-block,
.image-block {
flex: 1 1 50%;
}
img {
display: block;
width: 90%;
height: 150px;
margin-top: 30px;
line-height: 150px;
text-align: center;
border: 1px solid rgb(0, 0, 0);
}
<main>
<article>
<div class="text-block">
<h2>Heading</h2>
<p>Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph.</p>
</div>
<div class="image-block">
<img src="" alt="Image" />
</div>
</article>
<article>
<div class="text-block">
<h2>Heading</h2>
<p>Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph.</p>
</div>
<div class="image-block">
<img src="" alt="Image" />
</div>
</article>
<article>
<div class="text-block">
<h2>Heading</h2>
<p>Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph.</p>
</div>
<div class="image-block">
<img src="" alt="Image" />
</div>
</article>
<article>
<div class="text-block">
<h2>Heading</h2>
<p>Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph.</p>
</div>
<div class="image-block">
<img src="" alt="Image" />
</div>
</article>
</main>

This is the container and two sections which i'd like to display flex; one with the image on the left and text on the right. The next row text on the left, image on the right.
This is the container and two sections which i'd like to display flex; one with the image on the left and text on the right. The next row text on the left, image on the right.
<div class="search-filter-results" id="search-filter-results-2898">
<div class="container" style="background-color:#21002c;color:#fff;">
<div class="search-results"><h6>Viser 24 resultater</h6></div>
</div>
<div class="pagination">
<div class="nav-previous"><a href="http://staging.montra.dk/tilbud?sf_paged=2" >Ældre indlæg</a></div>
<div class="nav-next"></div>
</div>
<section id="post-3293" class="blok-item post-3293 odderparkhotel type-odderparkhotel status-publish kategori-tilbud hoteller-odder-parkhotel">
<div class="container-wrap">
<div class="container">
<div id="search-blok" class="row">
<div class="artikel">
<div class="artikel-image col-sm-12 col-md-12 col-lg-6" style="background:linear-gradient( rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.1)), url(http://staging.montra.dk/wp-content/uploads/2020/01/Weekend-intro.jpg); background-position: 0% 50%; background-size: cover;"></div>
<div class="artikel-content col-sm-12 col-md-12 col-lg-6">
<div class="hotel-name-artikel">
</div>
<div class="artikel-overskrift">
<h2>Weekendphold for 2 i Jylland</h2>
</div>
<div class="artikel-intro">
<p>Nyd et weekendophold for 2 på 4-stjernet hotel i Odder syd for Århus med velrenommeret køkken, som byder på udsøgte smagsoplevelser.</p>
</div>
<div class="pris-wrapper">
<h2 class="pris">KR. 995,-</h2>
<h4 class="pris-ekstra"></h4>
</div>
<div class="artikel-link-container">
<a class="knap-1" style="float:left" href="http://staging.montra.dk/odder-parkhotel/weekendphold-for-2-i-jylland">Læs mere</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="post-3290" class="blok-item post-3290 odderparkhotel type-odderparkhotel status-publish kategori-tilbud hoteller-odder-parkhotel">
<div class="container-wrap">
<div class="container">
<div id="search-blok" class="row">
<div class="artikel">
<div class="artikel-image col-sm-12 col-md-12 col-lg-6" style="background:linear-gradient( rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.1)), url(http://staging.montra.dk/wp-content/uploads/2020/01/Aarhus-intro.jpg); background-position: 0% 50%; background-size: cover;"></div>
<div class="artikel-content col-sm-12 col-md-12 col-lg-6">
<div class="hotel-name-artikel">
Montra Odderpark Hotel </div>
<div class="artikel-overskrift">
<h2>Mangler du også en studiebolig til studiestart 2020</h2>
</div>
<div class="artikel-intro">
<p>I Århus er der mangel på studieboliger og derfor vil vi på Montro Odder Parkhotel gerne hjælpe studerende, som er i akut boligmangel.</p>
</div>
<div class="pris-wrapper">
<h2 class="pris">KR. 2.000,-</h2>
<h4 class="pris-ekstra"></h4>
</div>
<div class="artikel-link-container">
<a class="knap-1" style="float:left" href="http://staging.montra.dk/odder-parkhotel/mangler-du-ogsaa-en-studiebolig">Læs mere</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>

Related

How can i center icons along with my text/paragraph in react?

How can i center my icons like <GrTools size="30px"/> along with my text? I am kind of having issues with some of my styled centering components.
my js:
<div id = 'paragraph' className="container" >
<h1 className='text-center' > Title <b> </b> </h1>
<p id='content' className='lead mb-4'> paragraph</p>
<hr className='col-xs-12 '/>
<p id='content' className='lead mb-4'> paragraph</p>
<GrTechnology className = 'responsive-image' size='30px'/>
<p id='content' className='lead mb-4'> Paragraph</p>
<GrTools size="30px"/>
<p id='content' className='lead mb-4'> Paragraph</p>
</div>
my css file:
div#paragraph{
width: 100%;
margin: 0px auto;
}
p#content{
text-align: center;
width: 100%;
margin: 50px auto;
}
Wrap the paragraph and icon in a div(container) and use flex-box display:flex on the container to align the children(icon & p)
as #man517 suggested this guide more then enough css-tricks.com/snippets/css/a-guide-to-flexbox
note: change the class to className 😉
.container{
display: flex;
}
<div id='paragraph' >
<h1 className='text-center'> Title <b> </b> </h1>
<p id='content' className='lead mb-4'> paragraph</p>
<hr className='col-xs-12 ' />
<div class="container">
<p id='content' className='lead mb-4'> paragraph</p>
<img src="https://img.icons8.com/ios-glyphs/30/000000/cat--v1.png" width='30px' />
</div>
<div class="container">
<img src="https://img.icons8.com/ios-glyphs/30/000000/cat--v1.png" width='30px' />
<p id='content' className='lead mb-4'> paragraph</p>
</div>
<p id='content' className='lead mb-4'> Paragraph</p>
</div>

How to make the images in horizontal row to move up?

I'm trying to move my horizontal row of images up a few pixels. How do I go about this? I'm a newbie.
This is my sample image. dont mind the mind blowing series of letters and numbers :) It is just a src code.
To move your images up a few pixels you should use the transform css style.
Its up to you if you want to set it in a class or id or directly in the img element as shown below. and set translateY([value]px) and your good to go..
Setting it to negative number of pixels will move the element or your image upward and otherwise if positive.
I hope it satisfies you. :)
Welcome to SO....
img
{
transform:translateY(-50px)
}
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExIVFRUWFRYYFhUWFhUVFhUVFRYXFhUVFRUYHSggGBolHRUXIjEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGi0lHyUtLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAMIBAwMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAADBAACBQYBB//EADoQAAEDAgQDBgUDAwQCAwAAAAEAAhEDIQQSMUEFUWETInGBkaEGMrHB8BRC0VJi4QcjM3Ky8TRDov/EABkBAAMBAQEAAAAAAAAAAAAAAAECAwAEBf/EACcRAAICAgICAgEEAwAAAAAAAAABAhESIQMxE0EEUUIiMmHwFCOB/9oADAMBAAIRAxEAPwDnyEtVcmHmEnXcvIiXaI2oqVKyUfUQTVT42MnQ46qksTUVX1ko+pJRUDSmWLlGheAIrAnJDFMK6G0wo6okcbHTLEq9MpY1Fdj1NxGTHA5eOaqUyjMKk9DMDkVX000WoVQQimTYnkVaiM9BqK8QCtQJSq1dFw7gFasC5re60ElxsIAJJG5sNlgxLrX1v5Fd3GTkEwRhbVCrKxKdo8z9vt7rRwzlPnhYEaeWUnisPKeolWdTXLB4sqonPVMIVRtNb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DscxTYtm9UUxYBAM3lO4KplEJStQhM0m9EjVPYI3YV9YkG3glalUjXVNl0IFSlOq3JFVoZoth3gXKJSdnBtqjCiIiBCHRMJlw4MyAVLQDdFc8EBDrs70oJaQkcX6N0CxVBo21QBY+SNi2F/kqEW6p4ykhGEwtLMeUpl2DaDI1CDw8kap8lNP7YySoAHOCHSquaTO6cJQayNqrRhetMzKrVDi2zlcyly46KcZNA6LMxFSNlFZptdRV/UC2bDNvNJHUqKK8eh2EoKtdRRLMDKO0RKOqiiSfYEFfqEduiiiEexhfFaFVweq9UVQex3FBKu2UUUZ/uCy7tEGjqV6oj7AXqpIfMoojIz7JikbDqKKT7CuyVVXEKKJX0YVzmBc6o4K9UQ/IUPsl6qiisg+ijEF26iiR9iM8YnKZsvFEWGJ44qtNRRH8QkcgnZRRaHQfQcBRRRMKf//Z" />
see if this works for you
.row img{
border: 1px solid #111;
box-shadow: 2px 5px 1px rgba(0,0,0,0.5);
}
.row1 img{
bottom: 8px;
position: relative;
}
.row2 img{
margin-bottom: 14px;
}
<div class="row row1">
<div class="col-md-12">
some text
</div>
<div class="col-md-12">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
</div>
<div class="col-md-12">
some text
</div>
</div>
<hr/>
<div class="row row2">
<div class="col-md-12">
some text
</div>
<div class="col-md-12">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
</div>
<div class="col-md-12">
some text
</div>
</div>

How do I center 2 divs in HTML Bootstrap?

As the title says, how do I center two divs next to each other perfectly?
My HTML: (or well, a bit of it)
<section class="team" id="team">
<div class="container">
<h3>The team behind CatCraft</h3>
<div class="divider">
<div class="hr">
<div class="hr-dot"></div>
</div>
</div>
<div class="row row-centered">
<div class="team-centered col-md-4">
<img src="http://cravatar.eu/helmhead/6a940db5e02d4bf79db9203a8b126f0d/140.png" alt="catx">
<h4 class="bold">CatX (Owner)</h4>
<p>Hi! I'm CatX and I'm the owner of CatCraft. I like anime and tech stuff. My favourite server is bending. =^_^=</p>
</div>
<div class="team-centered col-md-4">
<img src="http://cravatar.eu/helmhead/ef4fbdb6d629480d8f98ed9919c111e9/140.png" alt="__ast__">
<h4 class="bold">__Ast__ (Co-Owner)</h4>
<p>Example text, pls write something ;-;</p>
</div>
</div>
</div>
</section>
My CSS: (same here, this isn't all)
I tried to make a box for the css above too but it didn't work. http://pastebin.com/SzhAmh3f
Basically the problem I'm having is that the code above works kind of but one of the blocks are a little bit lower than the other and i have no idea why.
Yes, I know that there are other posts about this subject but no one worked for me so I decided to open my own.
There are a lot of unwanted styles actually to achieve this, you simply need the below code on your team-centered class. Remove row-centered class. It should look like this
CSS
.team img {
width: 140px;
height: 140px;
border-radius: 50%;
margin: 10px auto 40px;
}
.team-centered {
width: 50%;
float:left;
text-align: center;
}
HTML
<section class="team" id="team">
<div class="container">
<h3>The team behind CatCraft</h3>
<div class="divider">
<div class="hr">
<div class="hr-dot"></div>
</div>
</div>
<div class="row">
<div class="team-centered">
<img src="http://cravatar.eu/helmhead/6a940db5e02d4bf79db9203a8b126f0d/140.png" alt="catx">
<h4 class="bold">CatX (Owner)</h4>
<p>Hi! I'm CatX and I'm the owner of CatCraft. I like anime and tech stuff. My favourite server is bending. =^_^=</p>
</div>
<div class="team-centered">
<img src="http://cravatar.eu/helmhead/ef4fbdb6d629480d8f98ed9919c111e9/140.png" alt="__ast__">
<h4 class="bold">__Ast__ (Co-Owner)</h4>
<p>Example text, pls write something ;-;</p>
</div>
</div>
</div>
</section>

Full witdh DIV with CustomizR theme

I'm currently using Customizr theme, with the default settings for the pages set to "full width / no sidebars".
However, when I try do do something like this within a page :
<div id="blue-background">
<h1 style="text-align: center;">Full width text with background color ? >/h1>
</div>
with the corresponding CSS code :
#blue-background{
width: 100%;
float: left;
padding: 20px;
background: #2680BE;
position: relative;
}
I still have white margins around my text. Increasing the width doesn't seem to be a good solution, so how can I do ?
here is an example of what I get with this code:
http://www.cirnu.com/bandeau/
Your main-wrapper should look like this
<div id="main-wrapper">
<div class="tc-hot-crumble container" role="navigation"><div class="row"><div class="span12"><div class="breadcrumb-trail breadcrumbs" itemprop="breadcrumb"><span class="trail-begin">Accueil</span> <span class="sep">»</span> <span class="trail-end">Bandeau</span></div></div></div></div>
<div role="main">
<div class="row column-content-wrapper">
<div id="content" class="span12 article-container">
<article id="page-623" class="post-623 page type-page status-publish hentry row-fluid">
<header class="entry-header">
<h1 class="entry-title format-icon">Bandeau</h1>
<hr class="featurette-divider __before_content">
</header>
<div class="entry-content">
<div role="main">
<div id="blue-background">
<div class="container">
<h1 style="text-align: center;">Full width text with background color ?</h1>
</div>
</div>
</div>
</div>
</article>
</div><!--.article-container -->
</div><!--.row -->
</div><!-- .container role: main -->
</div>
Then you'll need to change some CSS rules:
#blue-background {
padding:20px 0;
/* then all the other rules you already have */
}
.article-container {
width:100%;
}

HTML date display alignment

I am designing a web page which has a list of dates appearing on below the other. I want to align the dates such that they line up perfectly below each other. I have tried using align but it didn't make a difference. I also tried putting a style tag but I got an error which said:
"Element "style" not allowed as child of element "div" in this context."
Here's the code of the page:
<div class="report-title">
<h1>Response Tracking Report</h1>
</div>
<div class="info">
<div style="width:93%;float:left;">
<p class="title">Project: </p>
<p class="value"><?php echo $response_data['project_name']; ?></p>
</div>
<div class="spacer"></div>
<div style="width:7%;float:left;">
<p class="value"><?php echo date("Y-m-d"); ?></p>
</div>
<div class="bottom"></div>
</div>
<div id='response-info' class='info'>
<div style='width:100%;'>
<p class='title'>Risk Statement: </p>
<p id='risk_statement' class='value'><?php echo $response_data['risk_statement']; ?></p>
<br/><br/>
</div>
<div style='width:24%;float:left;'>
<p class='title'>WBS: </p><p class='value'><?php echo $response_data['WBS']; ?></p>
<br/><br/>
<p class='title'>Date of Plan: </p><p class='value' ><?php echo $response_data['date_of_plan']; ?></p>
<br/><br/>
<p class='title'>Last Updated: </p><p class='value' ><?php echo $response_data['date_of_update']; ?></p>
<br/><br/>
<p class='title'>Planned Closure: </p><p class='value' ><?php echo $response_data['planned_closure']; ?></p>
</div>
<div class='spacer' style='width:1%;float:left;height:1px;'></div>
<div style='width:24%;float:left;'>
<p class='title'>Owner: </p><p class='value'><?php echo $response_data['owner']; ?></p>
<br/><br/>
<p class='title'>Cost: </p><p class='value'>$<?php echo round($response_data['cost']); ?></p>
<br/><br/>
<p class='title'>Release Progress: </p><p class='value'><?php echo $response_data['release_progress']; ?></p>
<br/><br/>
<p class='title'>Action: </p><p class='value'><?php echo $response_data['action']; ?></p>
</div>
<div class='spacer' style='width:1%;float:left;height:1px;'></div>
<div style='width:50%;float:left;'>
<p class='title'>Current Status: <br/> </p><p class='value'><?php echo $response_data['current_status']; ?></p>
<br/>
<br/>
<p class='title'>Action Plan: <br/> </p><p class='value'><?php echo $response_data['action_plan']; ?></p>
</div>
<div id='bottom' style='clear:both;width:100%'></div>
</div>
<div id="ResponseUpdateTableContainer" class="jTableContainer" style="width:100%;"></div>
</body>
How dates are displayed currently: http://imgur.com/UxbugwX
How I am trying to get them: http://imgur.com/mAgfRYO
I am new to html so please excuse my errors. All help is greatly appreciated.
To have those DIV'saligned, you need to give them the same width, the problem with this, is when you have dynamic text, and the length overflow your already specifyed width.
One solution, is emulate the native table style, with display property in your css
like this for example:
.table { display: table; }
.row { display: table-row; }
.cell { display: table-cell; }
Then, your html will have something similar to this markup:
<div class="table">
<div class="row">
<span class="cell title">WBS:</span>
<span class="cell value">1.1</span>
</div>
<div class="row">
<span class="cell title">Planned Closure:</span>
<span class="cell value">2014-07-18</span>
</div>
<div class="row">
<span class="cell title">Last Updated:</span>
<span class="cell value">2014-09-10</span>
</div>
<div class="row">
<span class="cell title">Date of Plan:</span>
<span class="cell value">2014-04-26</span>
</div>
</div>
jsFiddle example: http://jsfiddle.net/gmolop/csx10g64/
With this code the dates will be aligned:
HTML:
<div class="container">
<div class="title">Date of Plan:</div>
<div class="date">2014-04-26</div>
</div>
<div class="container">
<div class="title">Last Updated:</div>
<div class="date">2014-09-10</div>
</div>
<div class="container">
<div class="title">Planned Closure:</div>
<div class="date">2014-07-18</div>
</div>
CSS:
.container {
width: 600px;
}
.title {
width: 180px;
display: inline-block;
}
.date {
width: 180px;
display: inline-block;
}
You can see the result here: http://jsfiddle.net/ben220/fuzhvL54/
I hope it helps.
I was able to solve the problem using margin-left, adjusting it until the dates aligned.