I have this website made with wordpress with Astra but an astra child.
There is a default scroll top button which works fine but I cannot find out why the icon-arrow position is fine in all the pages but articles view.
(on astra theme official looks like fine)
I am not gonna make a reproduicible example as it is whole wordpress CSS and when I inspect I see the exact same CSS...
(I can fix the problem by adding a padding-top:20px on all articles for this button, but it is not the point here...)
Here it works: https://2b1stconsulting.com/news/
Here it does not: https://2b1stconsulting.com/digitalization-for-petroleum-and-renewable-projects/
Template PHP post
<?php
/*
* Template Name: News Template
* Template Post Type: post
*/
?>
<meta name="robots" content="noimageindex">
<?php
get_header(); ?>
<?php if ( astra_page_layout() == 'left-sidebar' ) : ?>
<?php get_sidebar(); ?>
<?php endif ?>
<div id="primary" <?php astra_primary_class(); ?>>
<section style="transition: background 0.3s, border 0.3s, border-radius 0.3s, box-shadow 0.3s;
padding: 20vh 0px 20vh 0px; background-image: url(/wp-content/uploads/2021/04/General-header-scaled-1.jpeg);
background-position: center top;
background-repeat: no-repeat;
background-size: cover;" class="elementor-section elementor-top-section elementor-element elementor-element-d7d8b56 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="d7d8b56" data-element_type="section" data-settings="{"background_background":"classic"}">
<div class="elementor-background-overlay"></div>
<div class="elementor-container elementor-column-gap-default">
<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-fd69444" data-id="fd69444" data-element_type="column">
<div class="elementor-widget-wrap elementor-element-populated">
<div class="elementor-element elementor-element-abcc2f2 elementor-widget elementor-widget-heading" data-id="abcc2f2" data-element_type="widget" data-widget_type="heading.default">
<div style="text-align: center;" class="elementor-widget-container">
<h1 style="color: #ffffff; font-weight: 100; letter-spacing: 1.4px; font-size: 5rem;"
class="elementor-heading-title elementor-size-default">News</h1>
</div>
</div>
</div>
</div>
</div>
</section>
<div style="border-bottom:1px solid #585858; border-bottom: 1px solid #585858; width: 70%; padding-top:30px; padding-bottom: 15px;" class="d-flex m-auto">
<span style="padding-right:15px;" class="ml-auto">Share on: </span>
<?php
$url=get_permalink();
?>
<a target="_blank" href="https://www.linkedin.com/sharing/share-offsite/?url=<?php echo $url; ?>">
<img style="height: 24px!important;;width: 24px;!important;" alt="logo linkedin" src="../wp-content/uploads/2021/04/linkedin-icon-2.svg"/>
</a>
</div>
<?php astra_primary_content_top(); ?>
<?php astra_content_loop(); ?>
<?php astra_primary_content_bottom(); ?>
</div><!-- #primary -->
<!--return button -->
<style>
.elementor-29677{
display:flex;
background: #fff;
padding: 20px 0;
}
.elementor-29677 .elementor-element.elementor-element-edbfa72{
margin-left: 15%;
}
.elementor-29677 a{
display:inline-block;
border:1px solid #000;
color:black;
transition: border 0s;
width: 180px;
text-align: center;
}
.elementor-29677 a:hover{
border: 1px solid rgba(0,0,0,0);
}
.elementor-29677 a .elementor-button-icon{
margin-right: 5px;
}
.elementor-29677 a svg{
transform: rotate(180deg);
margin-bottom: 2px;
}
.elementor-29677 a:after{
height:101%;
width:103%;
}
</style>
<div class="elementor-29677">
<div class="elementor-element elementor-element-edbfa72 black-icon mr-auto custom-btn-energy btn-hover-black elementor-widget elementor-widget-button" data-id="edbfa72" data-element_type="widget" data-widget_type="button.default">
<div class="elementor-widget-container">
<div class="elementor-button-wrapper">
<a href="/news" class="elementor-button-link elementor-button elementor-size-sm" role="button">
<span class="elementor-button-content-wrapper">
<span class="elementor-button-icon elementor-align-icon-left">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="6.707" viewBox="0 0 18 6.707"><defs><style>.a,.b{fill:none;stroke:#fff;}.a{stroke-linecap:round;}</style></defs><g transform="translate(-792 -818.146)"><line class="a" x2="17" transform="translate(792.5 821.5)"></line><line class="b" x1="3" y1="3" transform="translate(806.5 818.5)"></line><line class="b" x1="3" y2="3" transform="translate(806.5 821.5)"></line></g></svg> </span>
<span class="elementor-button-text">Return</span>
</span>
</a>
</div>
</div>
</div>
</div>
<?php if ( astra_page_layout() == 'right-sidebar' ) : ?>
<?php get_sidebar(); ?>
<?php endif ?>
<?php get_footer(); ?>
This is likely due to Quirks Mode enabled in the browser which is due to missing <!DOCTYPE html> on top of the page. This is why there is a difference in html rendering. Doctype of html is required
to inform the browser about document type to expect i.e HTML5.
Surprisingly the declaration is present on all other pages, which is where the arrow also seems correctly position, meaning it is most likely a theme bug. Two solutions are possible:
Quick css fix:
#ast-scroll-top .ast-icon.icon-arrow svg {
top: 50%;
transform: translate(0, -50%) rotate(
180deg);
}
Modify/Check header.php or track down why this <!DOCTYPE html> is being removed on this specific page. Exact solution ofcourse is possible if we have backend access.
try this
#ast-scroll-top {
background-color: rgba(226,0,26, .7);
transition: background-color 0.3s;
width: 3.1em;
height: 3.1em;
display: flex;
justify-content: center;
align-items: center;
}
also delete inline style display: block
just add this to your css
#ast-scroll-top span{
margin:1px;
}
Related
I am having a problem with my design.
I have two buttons on my product page. However because one is in a form, they are on top of each other(see image ).
I want to get the two buttons next to each other. Can someone help me out, please ? Below I added my HTML and CSS code.
Thanks in advance!
HTML:
<!DOCTYPE HTML>
<div class="container text-center">
<div class="sale">
<h1>On Sale</h1>
<p class="text-secondary">
We have new sales promotions online for a short period of time every day. We offer products from
popular labels and luxury brands in the lifestyle segment up to 75% cheaper than the
recommended retail price.
</p>
</div>
</div>
<section class="on-sale">
<div class="container">
<div class="row">
<?php
for($i = 0; $i < $countProductItems && $i < 4; $i++){
?>
<div class="col-md-3">
<div class="product-top">
<img src="<?php echo ($saleProducts[$i]['imgProduct1']);?>" class="img-fluid" alt="Product1"/>
<div class="overlay-right text-center">
<button type="button" class="btn btn-secondary" title="Quick Shop">
<i class="fa fa-eye text-white"></i>
</button>
<form action="includes/shopping-cart.inc.php?action=add&id=<?php echo ($saleProducts[$i]['ID'])?>" method="post">
<input class="text-center" type="hidden" name="quantity" value="1"/>
<input type="hidden" name="index-page" value="index">
<input type="hidden" name="product-name" value="<?php echo ($saleProducts[$i]['strProductNaam']); ?>">
<input type="hidden" name="product-price" value="<?php echo ($saleProducts[$i]['strSalePrijs']); ?>">
<button type="submit" class="btn btn-secondary " title="Add to cart" name="add_to_cart"><i class="fa fa-shopping-cart"></i></button>
</form>
</div>
</div>
<div class="product-bottom text-center">
<p>
<?php rating_star(($saleProducts[$i]['RatingStar'])) ?>
</p>
<p><h3><?php echo ($saleProducts[$i]['strProductNaam']); ?></h3></p>
<?php sale_product(($saleProducts[$i]['intPrijs']), ($saleProducts[$i]['strSalePrijs']))?>
</div>
</div>
<?php
}
?>
</div>
</div>
</section>
</html>
CSS:
.container .sale{
padding: 3rem 0;
}
.container .sale{
font-family: var(--gugi);
}
.container .sale{
padding: 0.5% 25%;
font-size: 0.9em;
}
.on-sale{
margin: 50px 0;
}
.on-sale img{
width: 100%;
padding: 20px;
transition: 1s;
cursor: pointer;
}
.on-sale img:hover{
transform: scale(1.1);
}
.product-top{
width:100%;
display: inline-block;
}
.product-bottom .fa{
color: orange;
font-size: 10px;
}
.product-bottom h3{
font-size: 20px;
font-weight: bold;
}
.product-bottom h5{
font-size: 15px;
padding-bottom: 10px;
}
.make_red {
color: red;
}
// codefilling text[error] - nfnjsnfjsfnbjkdsnfdsfndjsfbjabsdjhbgdgabadsg
try use display:flex
.overlay-right text-center{
display: flex;
justify-content: space-between;
width: 200px;
margin: 0 auto;
align-items: center;
}
You can give the form a display: inline in your css.
Default display is block for a form
You can try this as well--
button {
display: inline;
margin: auto;
padding: 5px;
}
Dear Stackoverflow community,
I just can't figure out how to center the footer links on my magento website. The footer links are within a div and the correspondig CSS is, as I believe, as follows:
I have tried everything, from margin:auto to margin-right and margin-left auto.
Then I thought, maybe the right footer, there used to be a newsletter box there, is forcing to take up space, so I slashed it out, but still no effect. Anyone any idea what could be the solution? Thank you so much!
.footer-container { width:100%; text-align: left;}
.footer { margin: 0 auto 0;width: 940px; padding: 0 20px 30px; background: #fff; }
.aditional-footer { margin:0 auto 0; padding: 30px 20px 35px; width: 940px; background: #FFF;}
.footer .links li { text-transform: none;}
.footer-container a { color:#666669; font-size: 9px; }
/*.footer-container .footer-right { width: 250px; }*/
.footer .f-left { width:520px; text-align: left; margin: 0 auto;}
/*.footer .f-right { width:420px; text-align: right; }*/
This is the HTML
<html>
<div class="footer-container">
<div class="aditional-footer">
<?php echo $this->getChildHtml('bottomContainer') ?>
<div class="f-right">
<div class="footer-right">
<div class="right-conteiner">
<?php echo $this->getChildHtml('newsletter') ?>
<div class="clear"></div>
</div>
<div class="right-conteiner">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_time')->toHtml(); ?>
<?php if(themeOptions('topbtn')): ?>
<div id="back-to-top"><?php echo $this->__('Back to top') ?></div>
<?php endif; ?>
<div style="clear: both;"></div>
</div>
</div>
</div>
<div class="f-left footer-left">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_shipping')->toHtml(); ?>
</div>
<div style="clear: both;"></div>
</div>
</div>
<div class="footer">
<?php echo $this->getChildHtml('bottomContainer') ?>
<div class="f-left">
<?php echo $this->getChildHtml('footer_links') ?><br />
<?php echo $this->getCopyright() ?>
<?php echo $this->getChildHtml('cms_footer_links') ?>
</div>
<div class="f-right">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('verify')->toHtml(); ?>
</div>
</div>
</html>
Change the following code
.footer-container { width:100%; text-align: left;}
to
.footer-container { width:100%; text-align: center;}
Let me know if you have any query
I'm making a simple product portfolio and using Bootstrap 3. Without captions my images look like this:
When I add captions under them they look like this:
I want them to stay like in picture one but with added captions below them.
Here is the HTML(with captions):
<div class="works-list type-one">
<div class="row">
#foreach($proizvodi as $proizvod)
<div class="col-md-3 col-sm-6">
<div class="work-item">
<div class="wi-over">
<h4>{{ $proizvod->naziv }}</h4>
<ul class="clearfix">
<li><img class="img-responsive"></img></li>
<li><i class="fa fa-file-text-o"></i></li>
</ul>
</div>
<img src="{{ $proizvod->slika_url }}" alt="Work Name" class="img-full-border">
</div>
<div class="row">
<div style="padding-top: 5px;">
<h5 style="font-weight:bold; font-size: 12px; text-align:center;">{{ mb_strtoupper($proizvod->naziv) }}</h5>
</div>
</div>
</div>
#endforeach
</div>
<div class="row">
<div style="text-align:center;">
{!! $proizvodi->render() !!}
</div>
</div>
</div>
I'm using Laravel so blade code is included.
Here are the related css classes:
.works-list.type-one{
margin-bottom : -30px;
}
.works-list.type-one .row div[class*="col-"]{
margin-bottom : 30px;
}
.works-list.type-one .work-item{
position : relative;
}
This problem only occurs when the caption is longer than 1 line.
Any ideas?
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #fff;
border: 0px solid #ddd;
border-radius: 4px;
-webkit-transition: border .2s ease-in-out;
-o-transition: border .2s ease-in-out;
transition: border .2s ease-in-out;
}
.row {
margin-right: 0px;
margin-left: 0px;
}
<ion-view title="Categories">
<ion-content ng-init="loadImages()">
<div id="catlist">
<div class="row" ng-repeat="image in images" ng-if="$index % 2 === 0">
<div class="col" ng-if="$index < images.length">
<a data-id="{{cats[$index].CategoryID}}" >
<span id="Content" class="col col-25 ">{{cats[$index].CategoryName}}</span>
<img ng-src="{{images[$index].src}}" width="100%" />
</a>
</div>
<div class="col" ng-if="$index + 1 < images.length">
<a data-id="{{cats[$index+1].CategoryID}}" >
<span id="Content" class="col col-25 ">{{cats[$index+1].CategoryName}}</span>
<img ng-src="{{images[$index + 1].src}}" width="100%" />
</a>
</div>
</div>
</div>
</ion-content>
</ion-view>
#Content {
background: rgba(0, 0, 0, 0.8) none repeat scroll 0 0;
color: #f4f2f3;
height: auto;
position: absolute;
text-align: center;
width: 310px;
text-decoration: none !important;
background-opacity: 0.1;
font-family: arial;
font-size: 15px;
font-weight: bold;
-webkit-transition: 0.5s;
-moz-transition: 0.5s;
-o-transition: 0.5s;
-ms-transition: 0.5s;
}
I have create the 2*2 image grid and shows the image caption on top of the image. But image caption width doesn't fit to image width. I am using ionic framework. How can I adjust image caption width depends on image width?
From checking in your css for #Content (this should be changed to class instead of id, because it suppose to has only one element for one id per page. But I don't think this why problem occur)
In your #Content style can you please try to change from
width: 310px;
to
width: 100%;
If this not work, try to add
display: block;
Hope this help, and sorry for my English :)
I apologize in advance if this question has already been answered but I'm having the hardest time making my logo linkable here: http://testsite.brentthelendesign.com/. This is a WordPress "Skeleton" based site. Any help would be greatly appreciated! The code is below.
HTML
<header class="left full header-bg">
<div class="container">
<div class="container-inside left">
<div class="sixteen columns">
<h1 class="logo abs"><a href="<?php echo get_option('home'); ?>"/></a></h1>
<nav>
<?php st_navbar(); ?>
</nav>
</div>
</div>
</div><!--container-->
</header>
CSS
h1.logo {
left:50%;
margin-left:-80px;
float: none;
text-align: center;
}
h1.logo a {
background:url(images/logo.png) no-repeat;
width:181px;
height:127px;
display:block;
text-indent:-9999px;
float: none;
text-align: center;
cursor: pointer;
}
.header-bg {
height: 190px;
background: url(images/bg-header.png) repeat;
}
> using this css you can display your logo with your home url.
h1.logo {
float: none;
left: 50%;
margin-left: -80px;
text-align: center;
z-index: 10000;
}
h1.logo a img{
display:block;
}
You're template is set up to use the WP_HOME value as the link, which is configurable in the Wordpress Admin under Settings > General. You can also override this value by explicitly setting the constant values in your wp-config.php:
define('WP_HOME', 'http://example.com');
define('WP_SITEURL', 'http://example.com');
You can also just edit the template file if you want to hardcode it (which is more efficient if it's never going to change), replace <?php echo get_option('home'); ?> with your desired URL.
Can you try instead of setting your logo as a background image through css to put it here?
<h1 class="logo abs">
<a href="<?php echo get_option('home'); ?>"/>
<image src="">
</a>
</h1>
Try this and tell me how it goes.