Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Joomla v3 with Bootstrap v2 - How to Remove Right Margin

Posted on 2013-11-07
5
Medium Priority
?
659 Views
Last Modified: 2013-11-11
Hi Experts,

I can't seem to remove the right margin nor padding within the header tag which holds three sub-tags namely, header-1, header-2, header-3 even though i specified their values to be 0px as can been seen from the attached image.

Please help.

Thanks in advance,
Rick


Html Codes:

<?php
defined('_JEXEC') or die;

// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');

// Load optional RTL Bootstrap CSS
JHtml::_('bootstrap.loadCss', true);

?>

<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width", initial-scal="1.0">
        <jdoc:include type="head" />
	
        <!--[if lt IE 9]>
		<script src="<?php echo $this->baseurl ?>/media/jui/js/html5.js"></script>
	<![endif]-->
        
        <!-- <title>Sample Tempalte</title>
        <link href="css/bootstrap.css" rel="stylesheet" type="text/css">
        <link href="css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
        <link href="css/bootstrap-extended.css" rel="stylesheet" type="text/css"> -->
        
        <!-- Custom Fonts -->
        <link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>
        
        <!-- Custom Styles -->
        <link href="templates/alpha1_0/css/custom.css" rel="stylesheet" type="text/css">
    </head>
    
    <body>
        <!-- Header Start -->
        <header class="row-fluid">
                
            <!-- Insert Logo Here -->
            <div id="header-1" class="span4">
                <jdoc:include type="modules" name="header-1" style="html5" />
            </div>

            <!-- Insert Slogan Here -->
            <div id="header-2" class="span4">
                <jdoc:include type="modules" name="header-2" style="html5" />
            </div>

            <!-- Insert Slogan Here -->
            <div id="header-3" class="span4">
                <jdoc:include type="modules" name="header-3" style="html5" />
            </div>
            
        </header>
        
    </body>
</html>

Open in new window


CSS Codes:

@charset "utf-8";
#header-1{
  background-color: red;
  margin-right: 0px;
  margin-left:  0px;
  border: 1px solid black;
}

#header-2{
  background-color: green;
  margin: 0px;
  padding:0px;
  border: 1px solid black;
}

#header-3{
  background-color: blue;
  margin: 0px;
  padding:0px;
  border: 1px solid red;
}

html {
  //width: auto !important;
  //overflow-x: hidden !important;
  border: 1px solid red;
  margin:0px;
  padding:0px;
}
body {  
  //width: auto !important;
  //overflow-x: hidden !important;
  border: 1px solid red;
  margin:0px;
  padding:0px;
  //background-color: yellow;
}

header {
  background:yellow;
  margin:0px;
  padding:0px;
}

Open in new window

website.jpg
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39633496
Obviously, something else in the page is affecting the rendering post a link and we can do a diagnostic.

Cd&
0
 
LVL 51

Accepted Solution

by:
Steve Bink earned 2000 total points
ID: 39634855
First and foremost, use Firefox + Firebug to determine exactly how the style is being applied.  It looks like you have your custom style sheet loading after Bootstrap, which is how it should be.  But you're also applying the style to the upper level container elements.  The <jdoc> directive to include the modules is going to create additional elements within that container - elements that can (and probably are) targeted by bootstrap styles.

Use Firebug to determine exactly which element is being targeted by bootstrap.  Then you have the option of either targeting that element in your custom style, or in a worst-case scenario, creating a custom chrome, alternate layout, or core override to replace the HTML currently being generated.
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39637952
Thank you for both or your replies. I'll will try using Firebug and will post back short.

Cheers
Rick
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39640440
I found the element that was being targeted by bootstrap.

.row-fluid .span4 {
    width: 31.6239%;
}

The total is not 100% and therefore 5.1283% leftover is what we see on the right.

I made the adjustment to 33.33% and it fits nicely.

Thanks for your help
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39640635
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Knowledge base software has turned out to be a quite reliable method for storing information, promoting collaborative work and for sharing valuable input and solutions.However, some organizations are trying to develop a knowledge base that works wit…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question