I'am using code pen website for quick preview and using it's bootstrap maybe version 3
<div class="container-fluid">
<div class="jumbotron">
<h1 class="text-center">Mohandas Karamchand Gandhi</h1>
<h2 Class="text-center text-muted">Mahatma Gandhi</h2>
<div class="img-thumbnail img-fluid text-center"><img src="http://school.eckovation.com/wp-content/uploads/2017/03/gandhi.jpg" width="1415px">
<div class="caption"><em>Mahatma Gandhi was the primary leader of India’s independence movement and also the architect of a form of non-violent civil disobedience that would influence the world.</em></div>
</div>
<br>
Using bootstrap's grid system
<div class="row">
<div class="card col-md-4">
<div class="card-body">
<h4 class="card-title">Who Was Mahatma Gandhi?</h4>
<p class="card-text">Mahatma Gandhi (October 2, 1869 to January 30, 1948) was the leader of India’s non-violent independence movement against British rule and in South Africa who advocated for the civil rights of Indians. Born in Porbandar, India, Gandhi studied law and organized boycotts against British institutions in peaceful forms of civil disobedience. He was killed by a fanatic in 1948.</p>
</div>
</div>
Want spacing in-between here
<div class="card col-md-4">
<div class="card-body">
<h4 class="card-title">Religion and Beliefs</h4>
<p class="card-text">Gandhi grew up worshiping the Hindu god Vishnu and following Jainism, a morally rigorous ancient Indian religion that espoused non-violence, fasting, meditation and vegetarianism.
During Gandhi’s first stay in London, from 1888 to 1891, he became more committed to a meatless diet, joining the executive committee of the London Vegetarian Society, and started to read a variety of sacred texts to learn more about world religions.
Living in South Africa, Gandhi continued to study world religions. “The religious spirit within me became a living force,” he wrote of his time there. He immersed himself in sacred Hindu spiritual texts and adopted a life of simplicity, austerity, fasting and celibacy that was free of material goods.</p>
</div>
</div>
Want spacing in-between here
<div class="card col-md-4">
<div class="card-body">
<h4 class="card-title">Gandhi’s Ashram & the Indian Caste System</h4>
<p class="card-text">
In 1915 Gandhi founded an ashram in Ahmedabad, India, that was open to all castes. Wearing a simple loincloth and shawl, Gandhi lived an austere life devoted to prayer, fasting and meditation. He became known as “Mahatma,” which means “great soul.”
In 1932, Gandhi, at the time imprisoned in India, embarked on a six-day fast to protest the British decision to segregate the “untouchables,” those on the lowest rung of India’s caste system, by allotting them separate electorates. The public outcry forced the British to amend the proposal.
</p>
</div>
</div>
</div>
</div>
</div>
Bootstrap 4 has spacing control classes as specified here
You can use such ml-2 to set margin left to be 0.5rem. The number can be:
0 : margin-left: 0;
1 : margin-left: 0.25rem;
2 : margin-left: 0.5rem;
3 : margin-left: 1rem;
4 : margin-left: 1.5rem;
5 : margin-left: 3rem;
There are other spacing controls as well, such as
mt for margin-top
pt for padding-top
.....
A fast solution that might need to play with it's margin and padding is to trying to add a border on the mid element. To do it you will have to:
create a CSS class like :
.sideborder{
border-left: 2px solid black;
border-right: 2px solid black;
}
Then you will have to add this class only into the mid div.
Although, i have to mention again that this might not be the best solution for you cause it demands a lot of css modification. Also condider for the space you want that you will either color the border sides as transparent or you will just add padding-left & padding-right to your mid div.
Related
Using Odoo 11 with wkhtmltopdf verion 0.12.1.3
All the default headers are not on any of the PDF reports I print, even when I try to preview the document templates in general settings.
I still have the footers though.
Furthermore the reports are very plain now, like the table-striped that has become a white plain column, or "row" that doesn't show the elements inside in a row but rather one under the other.
Edit :
To illustrate my problem here is what happen when I chose the Standard template in General Settings and I try to Preview the document.
There is what happends
What's strange is that I didn't touch - I don't think so - this header in any way (even though I've done some custom reports but unrelated).
Here is the code of web.external_layout_standard:
<?xml version="1.0"?>
<t t-name="web.external_layout_standard">
<div class="header">
<div class="row">
<div class="col-xs-3 mb4">
<img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % to_text(company.logo)" style="max-height: 45px;"/>
</div>
<div class="col-xs-9 text-right" style="margin-top:22px;" t-field="company.report_header" name="moto"/>
</div>
<div t-if="company.logo or company.report_header" class="row zero_min_height">
<div class="col-xs-12">
<div style="border-bottom: 1px solid black;"/>
</div>
</div>
<div class="row">
<div class="col-xs-6" name="company_address">
<span t-field="company.partner_id" t-field-options="{"widget": "contact", "fields": ["address", "name"], "no_marker": true}" style="border-bottom: 1px solid black; display:inline-block;"/>
</div>
</div>
</div>
<div class="article o_report_layout_standard">
<t t-raw="0"/>
</div>
<div class="footer">
<div class="text-center" style="border-top: 1px solid black;">
<ul class="list-inline mb4">
<li t-if="company.phone">Phone: <span t-field="company.phone"/></li>
<li t-if="company.email">Email: <span t-field="company.email"/></li>
<li t-if="company.website">Web: <span t-field="company.website"/></li>
<li t-if="company.vat"><t t-esc="company.country_id.vat_label or 'TIN'"/>: <span t-field="company.vat"/></li>
</ul>
<div name="financial_infos">
<span t-field="company.report_footer"/>
</div>
<div class="text-muted">
Page: <span class="page"/> / <span class="topage"/>
</div>
</div>
</div>
</t>
EDIT temporary SOLUTION
It might have been a cache problem since we were several people working on the same admin account at the same time.
Thus I copied the database. Checked it worked well in my new database (eureka!). Erased the old one. And changed the name of the copy by the old name.
BUT! at some point it keeps despairing again. I'm doing qweb changes in custom reports so I don't touch the headers but maybe it's connected...
It seems that your pdf processor (wkthmltopdf) is not finding the proper CSS to form the reports. I solved this issue in Odoo 11 with the following steps:
Create a new system parameter report.url
For this go to Settings -> Parameters -> System and check if the parameter report.url exists. If not create it.
Set the value of report.url to http://127.0.0.1:8069 or http://0.0.0.0:8069
This is by the way the approach suggested by CZoellner. I have learnt more insight from the discussion on headers and CSS in reports at Odoo Help.
I'm creating a list of employees (2 items in each row), and I've encountered several problems:
I want picture to use full space of left side of list item - the example is here: http://2fm9xz2drvqemrbu.zippykid.netdna-cdn.com/wp-content/uploads/2013/01/facebook-search-results.jpg
borders of list items with thumbnail class touches each other - I'd like to have some padding
My example in fiddle: http://jsfiddle.net/bC4Wy/
My list item code:
<div class="col-sm-6 col-xs-12 thumbnail">
<div>
<div class="col-xs-3"><img class="img-responsive" src="http://lorempixel.com/300/300/" /></div>
<div class="col-xs-9">
<div class="h4">Paul Smith</div>
<div>Title: Developer</div>
<div>Skills: C#, .NET</div>
</div>
</div>
</div>
I see that you're using thumbnail and putting "col" inside of col directly.
You may consider not using thumbnail at all:
<div class="col-sm-6 col-xs-12 listitem">
<div class="row">
<div class="col-xs-3"><img class="img-responsive" src="http://lorempixel.com/300/300/"/></div>
<div class="col-xs-9">
<div class="h4">Paul Smith</div>
<div>Title: Developer</div>
<div>Skills: C#, .NET</div>
</div>
</div>
</div>
CSS
.listitem {
border-radius: 5px;
border: 1px solid black;
overflow-y:hidden;
}
.listitem img {margin-left: -15px;}
I have also added additional row to insure your layout will be consistent. You may want to add styling for the border radius for mozilla and webkit.
We are using Bootstrap 2 on a Joomla 3.2.2 site. See: http://test.stuntlist.com/west
The first slide works perfectly, but when the second slide comes in, it disappears. You can see it start to transition between the slides, but then the area where the slide should be just disappears and the content is moved up into the slide area.
I don't see any JS errors on the site. We have used the same carousel code on other sites without this issue.
Here is the carousel code:
<div class="slideshow">
<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<a href="/component/joomgallery/action-photos?Itemid=88"><span data-picture data-alt="">
<span data-src="/images/hero/slide01.jpg"></span>
<span data-src="/images/hero/portrait/slide01mobile.jpg" data-media="(max-width: 768px) and (orientation:portrait)"></span>
<noscript><img src="/images/hero/slide01.jpg" alt=""></noscript>
</span></a>
<div class="carousel-caption">
<div class="container">
<h4>Slide Caption Goes Here.</h4>
</div>
</div>
</div>
<div class="item">
<span data-picture data-alt="">
<span data-src="/images/hero/slide02.jpg"></span>
<span data-src="/images/hero/portrait/slide02mobile.jpg" data-media="(max-width: 768px) and (orientation:portrait)"></span>
<noscript><img src="/images/hero/slide02.jpg" alt=""></noscript>
</span>
<div class="carousel-caption">
<div class="container">
<h4>Second Caption.</h4>
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a> <a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
</div>
</div>
Any idea what could be causing the problem?
Thank you.
This is caused due to a conflict with Mootools, download the following plugin and apply your preferences and it'll resolve this problem:
https://extensions.joomla.org/extension/mootools-enabler-disabler
The problem is Joomla adds another DIV (We will call it JDIV) outside the Carousel container, when second/EVEN Numbered Slides are viewed some script sets the height of the JDIV equal to "0px", see my code below
<div class="col-sm-12 pharma">
<!-- this is the div which joomla is adding (JDIV) -->
<div style="margin: 0px; position: relative; overflow: hidden; height: 0px;">
<!-- this is the div which joomla is adding (JDIV) -->
<div id="myCarousel" class="carousel slide" data-ride="carousel" style="margin: -203px 0px 0px; overflow: hidden;">
<div class="carousel-inner">
....
</div>
<div class="ind-div">
<ol class="carousel-indicators">
....
</ol>
</div>
</div>
</div>
</div>
The Solution
This solution worked for me and should also work for you too.
Add a CSS class named "#myCarousel" ( ID of the carousel) and sets its margin to 0px with important,
#myCarousel{ margin:0px !important; }
Secondly add another CSS class like
.pharma>div{ height:204px !important; }
where .pharma is the class which I have used on the DIV which is outside the JDIV. The height will be different from what I have used and might have to use media queries if using responsive.
To find the height simply inspect the element and note the height of the first slide and use that height in CSS class.
I do not have a fix for you but I was able to find a few issues. The first and biggest issue being that you have inline styling that is causing the image to "disappear". The image is really just moved 572px upwards and is off the screen. Notice the two images below. The first link is the image that does work. The second link is the image that does not display.
http://tinypic.com/r/hthi4y/8
http://tinypic.com/r/2hoix35/8
Using chrome, I opened the developer console and manually changed the margin to 0px instead of -572px and it fixed the issue. I would take a look at your JS again and see what values are being applied to each image because the entire display is being rendered dynamically, I assume for mobile devices.
I am using bootstrap 3 and noticed that my left margin gets indented little by little for each row.
Here's a snapshot depicted the issue I'm having, please check here
The code looks something like this for the first two rows in the image:
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="btn-toolbar well" role="toolbar">
...
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="row">
<div class="col-sm-6 col-md-6">
<div id="accordion2" class="panel panel-default">
You are putting a div inside a div and bootstrap applies a margin or padding (I forgot which one) to it.
test this out : In your style.css or equivelant do this :
.nopadtest{margin: 0px; padding: 0px;}
apply that class to your div's and see what happens. On a side note, you never closed any of the div's ! so you keep putting them in each other.
JSFiddle
<div class="container">
<img style="margin: 10px;" src="~/Content/Images/x.png" alt="" width="400" />
<span style="margin-left: 50px;" class="h3" >Connecting People & Businesses Since 1992</span>
</div>
The above displays just fine in a desktop browser. However, when viewed on a mobile device, the text that should remain to the right of the image wraps underneath the image.
<div class="container">
<img class="col-md-6" src="~/Content/Images/x.png" />
<span class="col-md-6 h3" >Connecting People & Businesses Since 1992</span>
</div>
So how do I Bootstrap this? I have tried using a col-md-6 class, but the text on the right no longer is vertically centered after using the grid.
<div class="container">
<img class="col-xs-6 col-md-6" src="~/Content/Images/x.png" />
<span class="col-xs-6 col-md-6 h3" >Connecting People & Businesses Since 1992</span>
</div>
col-md-6 means that everything above 'tablet' size is using 6 out of 12 columns. and everything below that size will revery to the full 12 of 12 because you did not specify anything [thats what you want except you want it all the way down to 'xs' size.
Does that help?
You can use a simple two column table.
Apply "vertical-align:middle" to the td element.