How move main menu to center in joomla - joomla

my main menu is aligned in left I want to move my main menu items in the center of the page.I'm using protostar template.

Assuming you are using Joomla 3.5 or later, create a file at: templates/protostar/css/user.css if it doesn't already exist and add the following contents to the file:
.navigation {
text-align: center;
}
.navigation .nav {
display: inline-block;
}

You open the file template.css in folder templates\protostar\css\template.css if you use template protostar.
And find the line of code:
.navigation .nav-pills {
margin-bottom: 0;
}
add code:
.navigation .nav-pills {
margin-bottom: 0;
display: flex;
justify-content: center;
}
As the following image

Related

Is there any reason why the pseudoelements ::after and ::before don't work in Foundation?

I'm using Foundation 6 for Sites to create a responsive site.
I failed to use pseudoelements ::after and ::before (I didn't forget about the content property).
My browser code inspector shows no pseudoelements and they are not implemented on the page.
Any ideas why it has happened and how to deal with it?
May it be a trouble with sass?
I use them all the time :)
You said you made sure you include the content: '' property inside the psuedo element, so that's good.
If the component is a Foundation CSS component and that element already uses a psuedo element, you can find it using the browser's inspector and see what CSS is targeting it.
Example:
.notification-reward {
align-items: baseline;
animation: jellyIn 1s;
display: flex;
position: absolute;
right: 0;
top: -58%;
&::after {
color: $primary-light;
content: attr(data-earned-points);
font-size: $stat-font-size;
font-weight: 700;
left: 4.3625rem;
position: absolute;
top: 6%;
}
&::before {
color: $primary-light;
content: '+';
font-size: rem-calc(44);
font-weight: 700;
left: rem-calc(40);
position: relative;
top: -1.6525rem;
}
}

Sass get sibling hover state for dropdown menu

I'm trying to build a fairly simple Sass mixin for a dropdown menu built as an html list
My html is
<div class="parent">
<div class="name">My Name</div>
<ul>
<li>profile</li>
<li>logout</li>
</div>
then I have a mixin which is applied to the UL
#mixin dropdown() {
// create a dropdown list from a ul
position: absolute;
display: none;
margin: 0;
padding: 0;
list-style-type: none;
&:hover {
display: block;
}
li {
padding: 0;
background-color: red;
}
li a {
#include button();
padding-left: 0;
}
}
Then I am trying to simply make the css by including the mixin in the parent
.parent {
position: relative;
ul {
#include dropdown();
}
&:hover ul {
display: block;
}
}
The problem is that the mixin needs to set ul { display:block} when I hover on the parent so the css needs to read .parent:hover ul {displa:block} but of course, I'd prefer to have it assigned to the parent rather than add the class on the parent itself.
I thought I should be able to do * &:hover or .parent:hover & or something of that sort, but any combination I've tried has not worked.
Using .parent:hover & creates css of
header .parent ul:hover, .parent:hover header .parent ul {
display: block; }
Which is not right.
Suggestions? Without having to specify the parent element would be preferred.
Originally I was trying to put the mixin no the dropdown itself, but thanks to #cimmanon pointing out that I didn't include how I am using the mixin, I reconsidered the approach and have re-created the mixin to be applied to the parent, which works pretty well, but somebody may have a better way.
.parent {
#include dropdown();
}
#mixin dropdown() {
display: relative;
// create a dropdown list from a ul
&:hover ul {
display: block;
}
ul {
position: absolute;
display: none;
margin: 0;
padding: 0;
list-style-type: none;
&:hover {
display: block;
}
}

Navigation Issue - Joomla

I'm having an issue where I cannot get my sub nav to hide until on Hover. I assume I accidentally just deleted some kind of css that I need, but I cannot for the life of me figure out what I did.
The link to the dev site is: http://fallriverbenefits.com/dev/
I solved this by adding this to the css:
.nav li ul {
position: absolute;
display: none;
width: inherit;
}
.nav li:hover ul {
display: block;
}
.nav li ul li {
display: block;
}

Replace menu item with icon (Media Queries - PrestaShop theme)

I've already received some valuable informations in answer related to my previous question but I still have the problem with media queries.
Previous question:
Replace menu item with icon (Prestashop theme)
I'm working with this demo:
http://livedemo00.template-help.com/prestashop_53577
The problem is connected with the look on mobile devices. Home icon is hidden. How to make similar effect on max-width: 767 px etc.? Classes are not the same in superfish-modified.css and I'm a little bit confused with that.
CSS Files which were changed:
blocktopmenu.css http://pastebin.com/PzyhH9x6
This code was added:
.stickUpTop.isStuck .sf-menu li:first-child a:before {
content: "\f015";
font-family: "FontAwesome";
display: inline-block;
font-size: 33px;
line-height: 55px;
color: black;
text-indent: 0;
width: 0;
left: 0;
}
.stickUpTop.isStuck .sf-menu li ul li a:before {
content: none!important;
}
.stickUpTop.isStuck .sf-menu li:first-child a:after{
width: 0;
}
superfish-modified.css:
http://pastebin.com/f2JG4hnT
This code was added:
.sf-menu li:first-child a {
text-indent: -9999em;
white-space: nowrap;
}
.sf-menu li:first-child a:before{
content: "\f015";
font-family: "FontAwesome";
display: inline-block;
font-size: 33px;
line-height: 70px;
color: black;
text-indent: 0;
width: auto;
left: 0;
}
.sf-menu li ul li a:before{
content:none!important;
}
You should add this:
.sf-menu li:first-child a:before {
position: absolute;
}
and remove on line 92 of superfished-modified.css the line
content: "";
because that is what remove you icon on smaller resolutions

Twitter Bootstrap dropdown menu width

Here is what i aim to do: https://docs.google.com/file/d/0B13W1jkpc_BzLXZ6RGxGbUd2NG8/edit?usp=sharing
Here is the CSS for my approach:
#media (min-width: 980px) {
.dropdown-menu .sub-menu {
left: 100%;
position: absolute;
top: 0;
visibility: hidden;
margin-top: -1px;
}
ul.nav li.dropdown:hover > ul.dropdown-menu {
display: block;
}
a.menu:after, .dropdown-toggle:after {
content: none;
}
.navbar .dropdown-menu {
margin-top: 0px;
text-align: center;
}}
And the way it looks now: https://docs.google.com/file/d/0B13W1jkpc_BzZUlRck5VcWh0TkE/edit?usp=sharing
Everything is working fine except that i can't seem to get the right width for the dropdown menu's text (i need to shrink the width according to text). So how do i do that ?
You have to remove the min-width property of the .dropdown-menu list. Including the following after you include bootstrap:
.dropdown-menu {
min-width: 0px;
}
Alternatively, for the exact style you have given, you could use bootstrap's tooltips instead
Try removing padding from the .dropdown-menu .sub-menu classes.
.dropdown-menu .sub-menu {
left: 100%;
position: absolute;
top: 0;
visibility: hidden;
margin-top: -1px;
padding: 0;
}
Well you can add space to your inner text and it will automatically increase its width e.g you have
"--View by Category--"
Add spaces with &nbsp as many as you want like
&nbsp--View by Category--

Resources