I am trying to have a "playoff bracket" on a wordpress site page. The brackets will be fed by database and PHP code to populate them with proper opponents and winners and losers each week.
So I am essentially trying to draw the brackets in some fashion on the page. I am working on it here: http://www.jerseybasketballassociation.com/1a-test-logo/
this is not perfect, just working on it; I only have the first two weeks on there…
if you do not know what I mean by "playoff bracket" you can see an example here:
http://printyourbrackets.com/8seeded.html
basically what I have is OK; but it would be much improved if I somehow was able to put some lines between the two weeks so you could see teams 1 and 8; they have lines that show the winner advancing to second week (labeled as team 1)
Does anyone have any ideas on how I would produces those lines using CSS/html?
I will also paste in the HTML and CSS code that puts this on the page:
<style>
#round1_boxa {border: 1px solid gray; padding: 2px; margin-bottom: 27px;}
#round1_boxb {border: 1px solid gray; padding: 2px; margin-bottom: 54px;}
#round2_boxa {border: 1px solid gray; padding: 2px; margin-top: 27px; }
#round2_boxb {border: 1px solid gray; padding: 2px; margin-top: 108px;}
#round2_boxc {border: 1px solid gray; padding: 2px; margin-top: 108px;}
#round2_boxd {border: 1px solid gray; padding: 2px; margin-top: 108px;}
#round1_cont {width: 150px; float: left;}
#round2_cont {width: 150px; float: left; margin-left: 20px;}
#game_box {margin-bottom: 30px;}
</style>
<div id="round1_cont">
<div id="game_box">
<div id="round1_boxa">
Team 1
</div>
<div id="round1_boxb">
Team 8
</div>
</div>
<div id="game_box">
<div id="round1_boxa">
Team 4
</div>
<div id="round1_boxb">
Team 5
</div>
</div>
<div id="game_box">
<div id="round1_boxa">
Team 3
</div>
<div id="round1_boxb">
Team 6
</div>
</div>
<div id="game_box">
<div id="round1_boxa">
Team 2
</div>
<div id="round1_boxb">
Team 7
</div>
</div>
</div>
<div id="round2_cont">
<div id="round2_boxa">
Team 1
</div>
<div id="round2_boxb">
Team 4
</div>
<div id="round2_boxc">
Team 2
</div>
<div id="round2_boxd">
Team 3
</div>
</div>
So I am trying to see if anyone has any ideas on how to draw those lines that go from box to box to delineate the advancing teams. Thanks so much...
You need to rethink the task and change markup.
<div class="c1">
<div class="team">1</div>
<div class="team">2</div>
<div class="team">3</div>
<div class="team">4</div>
</div>
<div class="c2">
<div class="block first">semi1</div>
<div class="block">semi2</div>
</div>
<div class="c3">
<div class="block">final</div>
</div>
<div class="c4">
<div class="block">winner</div>
</div>
CSS:
* {box-sizing: border-box}
.team {
text-align: right;
line-height: 40px
}
.c1, .c2, .c3, .c4 {
float: left;
width: 100px
}
.c1 .team {
width: 100px;
height: 40px
}
.c2 .block, .c3 .block {
margin-top: 40px;
height: 40px;
width: 100px;
border-top: solid 2px #000;
border-right: solid 2px #000;
border-bottom: solid 2px #000;
text-align: right;
line-height: 40px;
}
.c2 .block.first {
margin-top: 20px;
}
.c3 .block {
height: 80px;
line-height: 80px;
}
.c4 .block {
margin-top: 60px;
text-align: right;
border-bottom: solid 2px #000;
}
Full example here
http://jsfiddle.net/fncxsezn/
Related
I want to make this form to search for a keyword in my database that display and highlight it in my webpage with that specific words that is typed in the search bar. purpose of this code is a FAQ for a web-app I'm developing
<form>
<input type="text" placeholder="Search..." style=" flex: 1; padding: 12px 20px; margin: 8px 0; box-sizing: border-box; border: 2px solid #ccc; border-radius: 4px; width: 70%;">
<input type="submit" value="Search" style=" width: auto; padding: 10px 18px; background-color: #4CAF50; color: white; margin: 8px 0; border: none; border-radius: 4px; cursor: pointer;">
</form>
#foreach($kb_info as $kb_info)
<div class=" {{$kb_info->kb_category}}">
<a href="/adminkbView/{{$kb_info->kb_ID}}" class="card content {{$kb_info->kb_category}}" id="content clickable" style="margin: 1%; cursor: pointer; text-decoration: none; color: black;">
<div class="card-header">
{{$kb_info->kb_title}}
</div>
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>{{$kb_info->kb_content}}</p>
<footer class="blockquote-footer">{{$kb_info->kb_resolution}}<cite title="Source Title"></cite></footer>
</blockquote>
</div>
</a>
</div>
#endforeach
attached image is the preview of my web-page
I tried using this script and it does nothing.
const form = document.getElementById('search-form');
const input = document.getElementById('search-input');
form.addEventListener('submit', function(event) {
event.preventDefault();
console.log(`Searching for: ${input.value}`);
// Add your search functionality here
});
The first two elements inside my flexbox container containing my posts from wordpress float around 10px higher than the rest. They all have the same css. I'm using PHP to get the posts from wordpress. Its only on the top row that it does this. As you can see from the photo the same template and post format is used lower on the page and it does not have this issue. Please help.
I have already tried commenting parts of the code like the read more button or the icons to see if maybe margins or padding inside the post container is doing it but its not. I've tried setting a height on the flexbox container to 930px the exact height to stop it floating - that hasnt worked. This is after setting no margins on the posts but that still hasn't worked - they were previously 5px.
This is the html template for each post inside the post loop that has the standard post format. Each post: standard and image follow the css with the 'standard' in the class names and the quote and video post format follow the classes with 'quote' in them.
<article id="grid-post-<?php the_ID(); ?> " <?php post_class(); ?>>
<header class="grid-quote-entry-header">
<div class=" grid-quote-post-container">
<div class="grid-quote-icon-container">
<i class="fas fa-video"></i>
</div>
<div class="grid-standard-title-container">
<h2 class="grid-standard-title"><?php the_title(); ?></h2>
</div>
<div class="grid-standard-date-container">
<h5 class="grid-standard-date"><?php the_time('d/m/y'); ?></h5>
</div>
<div class=" grid-button" id="video-button">
<button><?php _e('Read More');?></button>
</div>
</div>
</header>
</article>
HERE IS THE POST FORMAT TEMPLATE FOR THE VIDEO AND QUOTE POSTS:
<article id="grid-post-<?php the_ID(); ?> " <?php post_class(); ?>>
<header class="grid-quote-entry-header">
<div class=" grid-quote-post-container">
<div class="grid-quote-icon-container">
<i class="fas fa-video"></i>
</div>
<div class="grid-standard-title-container">
<h2 class="grid-standard-title"><?php the_title(); ?></h2>
</div>
<div class="grid-standard-date-container">
<h5 class="grid-standard-date"><?php the_time('d/m/y'); ?></h5>
</div>
<div class=" grid-button" id="video-button">
<button><?php _e('Read More');?></button>
</div>
</div>
</header>
</article>
HERE IS INDEX PAGE
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div class="grid-post-loop-container exhale-posts-container">
<div class="grid-whole-container">
<?php
if(have_posts() ):
echo '<div class="page-limit" data-page="/'. exhale_check_paged()
.'">';
while( have_posts() ): the_post();
get_template_part('template-parts/gridcontent', get_post_format()
);
endwhile;
echo '</div>';
endif;
?>
</div>
</div>
</main>
</div>
HERE IS THE CSS:
.grid-whole-container{
display: inline;
flex-wrap: wrap;
flex-direction: row;
width: 100%;
}
.grid-standard-post-container {
width: 32%;
flex: 100%;
height: 300px;
-webkit-box-shadow: 10px 10px 19px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 10px 10px 19px -5px rgba(0,0,0,0.75);
box-shadow: 10px 10px 19px -5px rgba(0,0,0,0.75);
float: left;
}
.grid-standard-post-container:hover {
}
.grid-standard-title-container {
width: 80%;
margin-left: auto;
margin-right: auto;
}
.grid-standard-title {
font-family: coolvetica;
text-transform: uppercase;
color: white;
text-align: center;
letter-spacing: 3px;
text-shadow: 2.5px 3px black;
font-size: 27px;
position: relative;
top: 80px;
}
.grid-standard-date-container {
width: 30%;
margin-left: auto;
margin-right: auto;
}
.grid-standard-date {
letter-spacing: 6px;
color: black;
font-family: coolvetica;
font-size: 13px;
text-align: center;
position: relative;
top: 60px;
}
.grid-button button {
width: 50%;
margin-left: 25%;
margin-right: 25%;
position: relative;
top: 90px;
background: transparent;
background-repeat:no-repeat;
border: none;
cursor:pointer;
overflow: hidden;
outline:none;
font-family: coolvetica;
text-transform: uppercase;
color: white;
letter-spacing: 7px;
}
.grid-load-more {
margin-top: 100px;
}
/* INDEX GRID LAYOUT - QUOTE ======================================================================== ============================= */
.grid-quote-post-container {
width: 32%;
flex: 100%;
height: 300px;
-webkit-box-shadow: 10px 10px 19px -5px rgba(0,0,0,0.75);
-moz-box-shadow: 10px 10px 19px -5px rgba(0,0,0,0.75);
box-shadow: 10px 10px 19px -5px rgba(0,0,0,0.75);
float: left;
background-color: #aecfd7;
}
.grid-quote-icon-container {
color: white;
font-size: 60px;
text-align: center;
width: 30%;
margin-left: auto;
margin-right: auto;
margin-top: 30px;
margin-bottom: -70px;
}
Expected that these divs would all act the same as they all have the same css but top row floats up. Please help.
This is what it looks like.The first two should not float up like that
Got a loop going in a grid formation. 3 posts per row, per category. Using bootstrap to create the layout. At full width it's working and how intended, however it's not responsive. Any ideas what I got wrong here?
Full Width
https://www.dropbox.com/s/x77wxxp5gmtdrs9/Screenshot%202017-06-20%2017.28.31.png?dl=0
Reduced Width (not responsive)
https://www.dropbox.com/s/01baalrm3u1fybe/Screenshot%202017-06-20%2017.32.42.png?dl=0
Edited Outputted html and css (written in sass originally).
#blog-section {
padding: 53px 0
}
#blog-section h1,
#blog-section h2,
#blog-section h3,
#blog-section h4,
#blog-section h5,
#blog-section h6,
#blog-section a {
padding: 20px 0 10px 0;
-ms-word-wrap: break-word;
word-wrap: break-word
}
#blog-section h1 {
color: #72b466;
font-size: 30px;
line-height: 35px;
margin-bottom: 23px;
padding-bottom: 22px;
display: block;
font-family: 'PT Sans Narrow', sans-serif;
font-weight: 400;
border-bottom: 2px solid #ddd
}
#blog-section h2 {
font-size: 22px;
text-align: center;
line-height: 28px;
font-family: 'Roboto Slab', serif;
font-weight: 400;
margin-bottom: 12px
}
#blog-section h3 {
font-size: 28px;
text-align: center;
line-height: 28px;
font-family: 'Roboto Slab', serif;
font-weight: 400;
margin-bottom: 12px
}
#blog-section .blog-image {
width: 300px;
height: auto
}
#blog-section p {
font-size: 14px;
font-weight: 500px
}
#blog-section .blog-image {
margin: 0 auto
}
#blog-section a {
color: inherit;
text-decoration: none !important
}
#blog-section .shortlink {
color: crimson
}
#blog-section .custom-border {
padding: 10px;
margin-bottom: 20px
}
#blog-section .btn-home {
padding: 20px;
margin-bottom: 20px;
border-radius: 5px
}
#blog-section .btn-list {
padding: 20px;
margin-bottom: 10px;
border-radius: 5px
}
#blog-section .row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex
}
#blog-section .grid-loop {
border: 1px solid #ddd;
background-color: rgba(86, 61, 124, 0.15);
height: 100%;
padding: 10px;
border: 2px solid gray
}
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<section id="blog-section">
<div class="container my-container">
<div class="row row-eq-height">
<div class="col-xs-12 col-md-4">
<div class="grid-loop">
<div class="custom-border">
<a class="perm_link" href="http://localhost/certified-compostable-products/">
<h2>Certified Compostable Products</h2>
<div class="blog-image image-responsive"><img width="251" height="250" src="http://img.dummy-image-generator.com/abstract/dummy-251x250-DesiccationCracks.jpg" class="attachment-img-251x250 wp-post-image" alt="image4" /></div>
</a>
<p>
<p> PLEASE NOTE: We ALWAYS recommend that businesses replace disposable products with reusable ones. Waste reduction is the best way to handle your waste, followed by recycling and composting. Is there a way for you to stop using straws
altogether, rather than looking for a compostable straw? Or coffee cup? Or plate? That’s the goal. […]</p>
</p>
<span class="shortlink">
<button class="btn btn-success"><a rel="shortlink" href="http://localhost/?p=2382" title="Certified Compostable Products">Read More</a></button>
</span>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div class="grid-loop">
<div class="custom-border">
<a class="perm_link" href="http://localhost/importance-of-signage/">
<h2>Importance of Signage</h2>
<div class="blog-image image-responsive"><img width="251" height="250" src="http://img.dummy-image-generator.com/abstract/dummy-251x250-DesiccationCracks.jpg" class="attachment-img-251x250 wp-post-image" alt="image3" /></div>
</a>
<p>
<p>You may have read the title of this post and thought: “Everyone knows how to recycle, do I really need to put up signs?” Yes you do! It’s very, very important, and it’s the law!. Most people know, or think they know, the basics of recycling,
but when they are standing in front of three […]</p>
</p>
<span class="shortlink">
<button class="btn btn-success"><a rel="shortlink" href="http://localhost/?p=2372" title="Importance of Signage">Read More</a></button>
</span>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div class="grid-loop">
<div class="custom-border">
<a class="perm_link" href="http://localhost/nycs-commercial-recycling-laws/">
<h2>NYC’s Commercial Recycling Laws</h2>
<div class="blog-image image-responsive"><img width="251" height="250" src="http://img.dummy-image-generator.com/abstract/dummy-251x250-DesiccationCracks.jpg" class="attachment-img-251x250 wp-post-image" alt="image1" /></div>
</a>
<p>
<p>NYC’s commercial recycling laws are hard to keep up with and key information is often difficult to find. Don’t stress! We’ll help you stay up to date and in compliance. The most recent official notice regarding commercial recycling rules
in NYC was released by the NYC Department of Sanitation on February 5, 2016. Link to […]</p>
</p>
<span class="shortlink">
<button class="btn btn-success"><a rel="shortlink" href="http://localhost/?p=2356" title="NYC’s Commercial Recycling Laws">Read More</a></button>
</span>
</div>
</div>
</div>
</div>
<!--/.row-->
<div class="clearfix"></div>
</div>
<!--/.container-->
</section>
</html>
Check your image container and your images, I think they're not responsive.
Your .blog-image class has a fixed width and the images within it should have width or max-width set to 100%.
EDIT
Also, if you are trying to use the Bootstrap class for image responsiveness, you should use the class .img-responsive in the img tag, not in its container. And the class name is .img-responsive and not image-responsive.
Have you added responsive meta tag in head section? If not, then add this tag:
<meta name="viewport" content="width=device-width, initial-scale=1.0"> to head section of your html.
It turns out the problem was with the fixed height border.
.row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.grid-loop {
border: 1px solid #ddd;
background-color: rgba(86, 61, 124, .15);
height: 100%;
padding: 10px;
border: 2px solid gray;
}
Instead will make a media query that removes the border on smaller screen sizes.
#media (min-width: 992px) {
.row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.grid-loop {
border: 1px solid #ddd;
background-color: rgba(86, 61, 124, .15);
height: 100%;
padding: 10px;
border: 2px solid gray;
}
}
I'm working on making my first responsive WordPress theme. I ran into some trouble while working on single.php and comments.php. For some reason the comments section is pushing the sidebar down. I'm also having trouble making the comments responsive, which I think might be part of the issue because when I remove the comments section entirely from single.php, everything lines up correctly.
Here is a link to the page I'm speaking of http://mockup.artxwpn.com/2017/01/19/hello-world/
Just change the css from .container::after, .row::after, .u-cf from display: block; to display: inline; at line 419 from style.css
Full example:
.container::after, .row::after, .u-cf {
clear: both;
content: "";
display: inline;
}
It's because your #comment and #submit has a fixed value of width.
Try using media queries, or just change the width:600px to width:100%
Like this:
#comment {
background: #fff;
color: #000;
border-color: #efefef;
font-size: 15px;
font-style: normal;
font-weight: normal;
width: 100%;
padding: 5px;
border: 1px solid #000;
height: 100px;
margin: 10px 15px 10px 0px;
-webkit-box-shadow: inset 0px 0px 15px -10px rgba(0,0,0,0.75);
-moz-box-shadow: inset 0px 0px 15px -10px rgba(0,0,0,0.75);
box-shadow: inset 0px 0px 15px -10px rgba(0,0,0,0.75);
font-family: 'Quicksand', sans-serif;
border: 1px solid #f1f1f1;
}
#submit {
width: 100%;
height: 55px;
font-size: 17px;
line-height: normal;
border: 1px solid #000;
color: #fff;
background: #000;
font-family: 'Quicksand', sans-serif;
text-transform: uppercase;
}
You have closed the row before the sidebar , you need to keep in one row so that it is aligned properly .
You html structure should be like this . It will aligned your sidebar correctly
<div class="row">
<div class="eight columns" id="content"></div>
<div class="four columns" id="sidebar"></div>
</div>
For you now your html structure is like this
<div class="row">
<div class="eight columns" id="content"></div>
</div>
<div class="four columns" id="sidebar"></div>
Your sidebar is not held within the same <div class="row"></div>, it seems you are loading it afterwards.
Try including it within the same row.
<div class="row"><!-- Open row -->
<div class="eight columns" id="content"> <!-- Open Content -->
<!--Post Content-->
</div> <!-- Close Content -->
<div class="four columns" id="sidebar"> <!-- Open Sidebar -->
<!--Sidebar Content-->
</div> <!-- Close Sidebar -->
</div> <!-- Close row -->
I tested this within Google Chrome console and it works.
My client looks great in Firefox but looks a little funky in Chrome :(
Here's some of my html code.. from the Inventory layout
<div class="clientinventory">
<div class="objtitle">
<p>Ore Inventory</p>
</div>
<div class="invitemvalue">10</div>
<div class="invitemtxtholder">Copper</div>
<div class="invitemvalue">0</div>
<div class="invitemtxtholder">Iron</div>
<div class="invitemvalue">0</div>
<div class="invitemtxtholder">Gold</div>
<div class="invitemvalue">0</div>
<div class="invitemtxtholder">Platnium</div>
</div>
Here's some of my css code.. from the Inventory layout
.invitemtxtholder {
margin-top: 5px;
margin-right: 5px;
margin-left: 5px;
background-color: #543C25;
border: 1px solid #000;
color: #FFF;
width: 60px;
text-align: center;
float: left;
clear: left;
}
.invitemvalue {
clear: right;
float: right;
font-style: italic;
color: #000;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
margin-left: 0px;
width: 65px;
}
NOTE: I'm not allowed to post pictures apparently lol so heres the link
http://www.ultimate-miner.com/UM2/Client.php
I can see a difference.
The Submit button jumps down in firefox but stays inline in chrome.
Add some width with css to the submit button and that will be fixed :)