Is is possible to program my site in such a way that these two columns of posts on the homepage will also display as two columns on a smart phone? I'm using a twenty twelve child theme, which is a responsive theme, but the code I used to create the two columns of posts is pretty elementary, so it's just combining into one column on a smart phone.
below is an excerpt of code from my index.php that shows the way i'm creating the two columns. these divs also correspond with simple CSS in my style.css file
i'd gladly take a different approach to creating the columns if it allows them to show as two independent columns on a smart phone as well.
the site is at: internalcompass.us/castle if you want to look at the page
thanks
</div>
<div id="right-column">
<?php $my_query = new WP_Query('category_name=favorites');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate[] = $post->ID ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
</div>
<div id="left-column">
<?php $my_query = new WP_Query('category_name=Recents');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate[] = $post->ID ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
</div>
Change your right-column and left-column from a width of 270px to a width of 50%. Then when your window is above 600pixels (most modern phones), you'll still see two columns.
I.e. edit your style.css (not the main theme style.css) and change:
div#left-column {
width: 270px;
float: left;
clear: none;
}
div#right-column {
width: 270px;
float: right;
clear: none;
}
to:
div#left-column {
width: 50%;
float: left;
clear: none;
}
div#right-column {
width: 50%;
float: right;
clear: none;
}
though you may want to add a little padding/margin room after doing this.
Is that what you're looking for?
Related
I´m trying to do the following on a website. I guess it´s quite simple for thoose who have programmed alot but for me it´s new. Can someone show me how to code this? Thanks!
Layout on computer screen and mobile screen
You need to use media queries to make your HTML and CSS code produce different results in user's browser on different devices.
Media queries usually based on max-width of the browser viewport.
So, if browser viewport will be less than 800px wide, additional styles will be applied.
.box
{
display: inline-block;
margin: 0 10px;
width: 180px;
height: 180px;
border: 1px solid #CCC;
background: #DDD;
}
#media screen and (max-width: 800px)
{
display: block;
}
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
For iPads & iPhones
If you need to have different layouts on iPads and iPhones, you need to take proper media queries from this article: http://stephen.io/mediaqueries/.
You have to write specific CSS rules for each device you'd like to support in particular.
Layout examples:
Desktop layout
Tablet layout
Phone layout
(Pictures are from w3schools.com)
About media queries:
https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
http://www.w3schools.com/css/css_rwd_mediaqueries.asp
https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
I'm using Ionic Framework to develop a mobile application for Android.
My issue is that I need to have a list of containers at random positions and are able to be clicked.
The list of containers are displayed correctly at the random positions but the click areas only work when i click at the top of the view, not at the position itself.
The clicking works fine in the mobile browsers at the correct position but when I run the app as a native application in Android, the clicks messed up.
It seems like clicking areas are lined up at the top of the view, does anyone know what is causing this?
The codes are here:
HTML file
<div class="col" ng-model="qtablelayout">
<div qtable ng-model='qtable' ng-repeat='qtable in qtablelayout.qtables' class="tablediv" ng-class="qtable.tstatus" ng-style="{'left': {{qtable.x}}+'px', 'top':{{qtable.y}}+'px'}" ng-click="tblActions(qtable)">
<h2>{{qtable.tableNo}}</h2>
<ul>
<li class="tablesize">{{qtable.currentHP.qsize}}/{{qtable.maxSize}}</li>
<li class="tabletime">{{qtable.tabletime.hours}}h {{qtable.tabletime.mins}}m {{qtable.tabletime.secs}}s</li>
</ul>
</div>
</div>
CSS file
div.tablediv
{
position: absolute;
background: url("../img/table/tablestatus.png") no-repeat;
color: #fff !important;
width: 178px;
height: 178px;
padding: 0;
margin: 0;
text-align: center;
display: block;
overflow: hidden;
}
The Controller side
$scope.tblActions = function(m)
{
alert("x:" + m.x + ",y:" + m.y);
}
I found out the cause of the problem is that I had an Ion-Refresher before the list of containers and it seemed to have shifted up the clicking areas together with the space for the Ion-Refresher.
It worked when I put the Ion-Refresher at the bottom of the HTML.
I'm trying to find out how to display pagination buttons withou displaying numbers over the buttons. In documentation there is no word about this, but i assume that it's possible to manage this thing.
You can do this with Javascript or simply CSS by hide the text content.
For example if you paginated your results in like this means
<div id="paginator">
<?php echo $this->Paginator->prev('Previous'); ?>
<?php echo $this->Paginator->first('First'); ?>
<?php echo $this->Paginator->numbers(array('class' => 'number', 'first' => false, 'last' => false, 'separator' => '-')); ?>
<?php echo $this->Paginator->last('Last'); ?>
<?php echo $this->Paginator->next('Next'); ?>
</div>
Using CSS you can hide as follow
<style>
#paginator span
{
border:1px saddlebrown solid;
padding:3px;
margin: 2px;
background: #1e7ec8;
color: brown;
}
#paginator span a
{
text-decoration: none;
color: white;
}
#paginator .number a
{
color:transparent;
}
</style>
Also using Javascript or Jquery you can set text of numbers class empty by following
$(document).ready(function() {
$('.number').text('');
});
I have a website running on a mapping platform called Ushahidi. The default template is quite boxy so I was fiddling with the CSS and rounding everything off using border-radius.
It has helped with other elements but the map is such a square it won't ease up!
It might be that it's not possible, wondered if anyone here had any experience of this. The html using inspect element and view source are different. Not sure what this means exactly but guessing that the html is pulled in by the map provider?
Here is the html on view source:
<div class="map " id="map"></div>
<div style="clear:both;"></div>
<div id="mapStatus">
<div id="mapScale"></div>
<div id="mapMousePosition"></div>
<div id="mapProjection"></div>
<div id="mapOutput"></div>
</div>
I've added a screen of inspect element HTML too. Looks like it's using "Open Layers". I've heard of that but don't fully understand whats going on.
Is it possible to round the edges of my map? Here is the site if that helps: http://tinyurl.com/c8djrvr
Apply the border-radius to two layers.
CSS
div.map {
border: #999 1px solid;
width: 800px;
height: 366px;
position: relative;
height: 650px;
border-radius: 25px; /* ADD THIS */
}
#OpenLayers_Map_11_OpenLayers_ViewPort {
border-radius: 25px; /* ADD THIS */
}
It works. Use however many pixels you want. I used 25px.
I would suggest more general and safer CSS selectors (since ID #OpenLayers_Map_11_OpenLayers_ViewPort is generated by OpenLayers and it's value is unpredictable; and OL 2.12 and older produce ID's, that contain dot and are therefore unsuitable for CSS selectors):
.olMap, .olMapViewport {
border-radius: 25px;
}
I am pretty new to Selenium Webdriver, so pardon me for all d 'noob' terminology used.
I have a dynamic table on the page, with 4 columns in the table. Out of this, only the first column name can be edited. The table looks like this :
Now using Webdriver, I need to locate 'group102' and verify the Level and the number of Cards (basically the text of the rest of the two columns) corresponding to 'group102'. The key point to note here is that this group is dynamic in nature. Right now, its sitting in row 3 but tomorrow, it may be on row 1 or row 10.
I am using Visual Studio (C#) and Selenium webdriver.
Please let me know how can I progress
EDIT :
HTML CODE:
<div id="formbland-1013" class="x-panel x-panel-default x-form-bland x-form-base" style="height: 9588px;">
<div id="formbland-1013-body" class="x-panel-body x-panel-body-default x-panel-body-default" style="left: 0px; top: 0px; width: 680px; height: 9588px;">
<span id="formbland-1013-outerCt" style="display: table; width: 100%; table-layout: fixed;">
<div id="formbland-1013-innerCt" style="display:table-cell;height:100%;vertical-align:top;">
<div id="ext-comp-1026" class="x-panel x-panel-default x-form-bland x-form-base" style="width: 680px; height: 47px;">
<div id="ext-comp-1036" class="x-panel x-panel-default x-form-bland x-form-base" style="width: 680px; height: 9541px;">
<div id="ext-comp-1036-body" class="x-panel-body x-panel-body-default x-panel-body-default" style="left: 0px; top: 0px; width: 680px; height: 9541px;">
<span id="ext-comp-1036-outerCt" style="display: table; width: 100%; table-layout: fixed;">
<div id="ext-comp-1036-innerCt" style="display:table-cell;height:100%;vertical-align:top;">
CODE WHICH I AM TRYING :
ReadOnlyCollection<IWebElement> select = WebDriver.FindElements(By.XPath("//td[contains(text(),'group102')]"));
if ("group102e".Equals(select.ToString()))
{
throw new SystemException("Group matches according to the Access");
}
else
{
throw new SystemException("Group does not matches according to the Access");
}
I can't provide exact code as I don't know the HTML for the table. But here are the code in theory.
You get the IWebElement input first by text first, then go to ancestor td's siblings (i.e. the next two column cells in this row), then get the element's text.
IWebElement inputGroup = WebDriver.FindElement(By.CssSelector("tbody input[value='group101']"));
IWebElement level = inputGroup.FindElement(By.XPath("(.//ancestor::td/following-sibling::td)[1]"));
string levelA = level.Text;
My questions about your code:
"group102e".Equals(select.ToString()) doesn't make sense, since your select is ReadOnlyCollection<IWebElement>, which is a list of IWebElements, ToString won't get you anything useful?
var location = WebDriver.FindElement(By.CssSelector("tbody input[value='Practice Wide Group 2']")).Location.ToString();, what do you want here? The location of the element (which is in the type of System.Drawing.Point)?