I have a logo in the header of my wordpress site and I would like to add an adsense banner next to it like this :
For my logo, I have a div logo and this css code :
#logo { float: left; margin-top: 60px; }
I know I need to create a new div for my adsense code but what css code should I use so the adsense banner appear to the right just next to the logo ?
I need to make sure that both div will never be superimposed (on all devices).
This should work:
HTML:
<div id="logo">
Some code here for the logo
</div>
<div id="ad-banner">
Ad banner goes here
</div>
<div style="clear:both;"> </div>
CSS:
#ad-banner
{
float: right;
margin-top: 60px;
}
Putting the HTML in the header-middle div and the #ad-banner style into the style.css file. It should work.
Open WordPress Editor
Open the header.php file
In this file – look for the following code
<header id=”masthead” role=”banner”>
Make the following change to the hgroup tag by adding style=”display:inline-block”
Immediately below the hgroup tag, add the Ad (Google AdSense) Code inside a span block as shown below:
<span style=”float:right”>
<!– Paste Ad Sense Code below–>
</span>
Save the file
Source: http://techzog.com/wordpress/how-to-add-banner-ad-to-wordpress/
Related
In Jsreport am having 5 to 6 pages of content. I am having the footer also. So i want to set the footer in bottom of last page. Please anyone suggest.
Try this,
Let me know if this helpful.
<footer style=" position:fixed; bottom:0px; left:0px; right:0px;border:1px solid red;">
<h1>This is my footer</h1>
</footer>
I think you can't solve this with just css, because fixed or absolute positioning of the element will make the footer visible on every page and you want to have it just on the last one.
However I believe you can solve it with jsreport pdf-utils extension. The trick looks like this.
Define an extra template representing the footer. Use the css to put the content to the bottom. And use custom handlebars helper to display the footer only for the last page.
{{#lastPage}}
<style>
.footer {
position: fixed;
bottom: 0;
width: 100%;
background-color: red;
}
</style>
<div class='footer'>
content
</div>
{{/lastPage}}
// custom helper
function lastPage(opts) {
if (this.$pdf.pageIndex === (this.$pdf.pages.length - 1)) {
return opts.fn(this)
}
return ''
}
Then append to the main content an empty placeholder which will reserve the space for the footer.
<!--placeholder for the footer-->
<div style='height:50px;'></div>
The last step is to configure pdf utils extension to merge the footer template with "render for every page" selected.
I prepared demo in the jsreport playground so you can fiddle with it.
https://playground.jsreport.net/w/anon/~~Cb62wD
I am attempting to create a footer tag to change the background color of it.
footer {
display: block;
background-color: #92a8d1 !important;
}
<footer>
<div class="container-fluid" name="footer">
</div>
</footer>
Code
Code
Could someone help me fix the code for CSS color displays on the footer?
I cant comment yet so will just answer here. You might not have a height for your footer, that is why it is not showing. Try setting a height like:
footer {
/*display: block;*/ /*remove this, footer is already a block element*/
height: 200px;
background-color: #92a8d1 !important;
}
This might help. You can send a sample/plunk of your code in order for us to help you better.
This is because the footer does have to be inside the body. After the body comes only the closing html-Tag.
If you want a footer for your page, add it before the closing body Tag. This is the same behaviour as if you would have a p-tag in another p-tag. The browser auto corrects your errors and places them next to each other.
If I got your question right this should work :
<footer style="background-color: #92a8d1;">
<div class="container-fluid"> </div>
</footer>
I think the background-color is overwritten by an other style.
I'm trying to add in a sponsor logo into the top right corner of the Navigation Pane of my website using CSS.
Here is my website link: www.headlightshortfilm.com.au
Does anyone know how to do this using CSS? Squarespace can't help me so I was about to pay a Squarespace specialist to do it but I feel it must be pretty simple. I thought i'd try here first :)
Add this Div after your <div id="topNav" style="padding-right: 0px;"></div>
<div class="sponsored-logo">
<img src="imageURL">
</div>
Add this class on your stylesheet
.sponsored-logo {
float: right;
}
Add float: left; to your #logo and #topNav
Hope this helps.
I'm trying to figure out how to add an image between blog posts (i.e., a graphic basic divider line, not a border) on my website: www.sacspartans.org
I know how to create and div, add the image, etc. But I don't know what file to make the modification to. Does anybody know?
I'm using Toolbox, the bare bones starter theme.
Any help would be much appreciated.
EDIT: I opened up the index file... but I'm not sure where to add my div.
Add the div right above <?php endwhile; ?>
Make it so that the three divs are like this:
<div class="div">
//blogpost 1
</div>
<div class="div">
//pic
</div>
<div class="div">
//blogpost 2
</div>
CSS
.div {
float: left;
display: inline;
//rest of css
}
I am working with WordPress and I am trying to modify my template so that on my blog pages. I have a menu on the right hand side of the page while the blog content is on the left. The problem I am having is that all the space under the menu <div> is wasted and I would like to have the blog content wrap/flow around the menu <div>. Normally I would float the menu <div> to the right, however the WordPress engine outputs this <div> after the blog content so I am not sure how to float it to the upper right corner of the page.
I have created a JSFiddle example to illustrate.
You can use a short bit of JavaScript to move the menu as necessary. See the JSFiddle I forked from yours.
Essentially I modified the HTML to add ids to the menu and the blog content, something like this:
<div id="blog">
<p>...</p>
</div>
<div id="menu">
...
</div>
Then I styled them like so in CSS. Note that the menu has an explicit width but the blog content itself does not.
#blog { }
#menu {
float: right;
width: 400px;
}
Then I used a quick bit of JQuery to move the menu into the blog so that it can float right and the text will wrap around it:
$('#blog').prepend($('#menu').remove());
Essentially what the JavaScript does is it removes the menu from the dom and then inserts it as the first child in #blog.
You need to set float of menu to right and put it on top of the post div.
For example, the CSS should be like this:
#post {width: 500px;}
#menu {
float: right;
width: 250px;
height: 100px;
color: #6666FF;
border: solid 1px #333;
}
And HTML:
<div id="post">
<div id="menu">lorep ipsum</div>
</div>
You can wrap text around a div like you would do with an image e.g: http://jsfiddle.net/Nbpen/