Alight text in header using custom.css in wordpress [closed] - css

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
i just want to center my menu in my header .
My website : http://test.projekt-tenis.pl/wordpress/
and my header now looks like :
All i want to do is just center my menu it's little too left . How can i center it using only wp-admin and custom.css .
I try to use google edit :
but can't find solution all the time i move all the menu to left cac't just center it. Can enyone help? and i just want to align social icon to right but don't know why i have so much space beetwen them like this :
EDIT 1
I add what you wrote but its looks like the same check it : i just want do delete space beetween facebook icon and linked in icon want the same like next to twitter and linked in.
And as i said i need to center my menu when you open my site you gonna see main menu : Główna , Oferta etc. Is not in the center its little paddig do left i want to center it using custom.css

The HTML is not properly written so there is no proper way (I'm aware of) to centre Navigation by using proper CSS. However, navigation can be centered by adjusting margin/padding but it's Not Recommended
So, you would need to make changes in HTML code: (Recommended)
How:
Create 3 separate div's for (Logo, Nav and Social)
Assign specific width (according to your needs)
Add css property to align left: float: left;
Finally, apply text-align: center; to Navigation
Example:
#container{
width: 100%;
}
#container div{
float: left;
}
#logo, #social{
width: 15%;
}
#nav{
width: 70%;
text-align: center;
}
<div id="container">
<div id="logo">
LOGO
</div>
<div id="nav">
NAVIGATION ITEMS
</div>
<div id="social">
SOCIAL
</div>
</div>
And there is extra padding applied to one of social media icon and you can fix in two different ways:
1. Find below piece of code and change padding-right: 10px to padding-right: 0px
Old: (Currently, look like this)
.primary-menu li:nth-last-child(-n+3) {
float: right;
padding-right: 10px;
}
New: (Should look like)
.primary-menu li:nth-last-child(-n+3) {
float: right;
padding-right: 0px;
}
2. Add below code in custom.css or other styles file.
.primary-menu li:nth-last-child(-n+3) {
padding-right: 0px;
}
NOTE:
First method is the Best and Recommended way
The second method is not recommended. I just mentioned because you looks beginner so maybe you'll have some difficulties in locating original style and in that case, you can try 2nd solution.

Related

Setting up Wordpress Theme - Post content makes screen scroll

Newbie question.
I'm just learning how to create WordPress themes.
Every-time I start a new project, the texts of posts scroll off the screen rather than wrapping to it.
See the picture attached.
enter image description here
I haven't yet added any CSS.
I've added the HTML doc header to the Header file and closed it in the footer file.
Am I missing something here? When I watch tutorial videos everyone else's post/page content is wrapped to the screen with no side-scrolling.
Any help greatly appreciated!
Thanks,
James
You can use main <div>
<div class="container">
// Your Content
</div>
in your <body> and give the CSS of width, padding and margin as your requirement. Like below
CSS
.container {
width: 100%;
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}

White-space right hand side of the page

I uploaded the WordPress few days ago and found out that the one on local host and the one on the website www.noteid.com are different.
The one on the website has the white-space on the right hand side:
So I did test it with my theme and the one that WP has: Twenty-Fourteen
All the others theme work fine but two of those.
It seem like: html { overflow-x: hidden } work but I want to find what cause the problem. I took 2 days do the research and feel like nothing work out.
Can anyone help me to point out what happening to my website?
Thank in advance.
This is CSS: http://jsfiddle.net/n9zqygcj/
The reason this is happening is that the #footer width is 105% of the page.
You need to change:
#footer {
padding-left:0;
}
#colophon {
margin-left:5%
}
So that the footer isn't longer than it should be.
EDIT:
Here is the updated CSS.
http://jsfiddle.net/n9zqygcj/2/
The <a> tag which is wrapped around the <div id="footer"> should be assigned a class, for e.g. <a href="#" class="footerlink"> and then the following styles should be added to inside your stylesheet:
.footerlink {
display: block;
width: 100%;
overflow: hidden;
}
Apart from this, also add the following style to your stylesheet:
.metaslider {
overflow: hidden;
}
Hopefully this will eliminate the problem of extra white space on the right side which you're facing on your website.

Align icons and images to right, textarea to left (twitter-Bootstrap)

TL;DR : Before you read anything, the desired end-result is illustrated in the image below, otherwise refer to the JSFiddle. Preferably, I would like to only use CSS and not modify the DOM structure.
The icons must be aligned completely to the right (hence the .pull-right), but the icons must be stacked vertically (Sometimes some icons must not appear, so they are .hidden, like the .fa-undo icon in the second row).
(When I say 'the icons' i mean the <i> tags and the <img> tag)
The icons must not make the textarea go down (no margin on top of the textarea).
Hopefully, the WIDTH of the textarea would be dynamic and not statically put to width: 90%; for example. It should take as much width as possible, without interfering with the vertical icon stack.
Here is the end result that I want (in a perfect world this would be done using CSS and the same HTML DOM I provided)
In general, images that are UI elements, and not content, should be CSS backgrounds, not inline images. You then use class names to control the image content.
You should be doing this, or something similar:
td.fr {
background-image:url(/images/fr.gif);
background-repeat:no-repeat;
background-position: top right;
}
The same should go for your buttons. Use <button> and style the background.
Not exactly what you wanted I'm afraid, but this is how I'd achieve that result:
fiddle
<div class="pull-right icons">
<img src="http://www.convertnsftopst.net/images/gb.gif" class="pull-right" />
<i class="fa fa-reply"></i>
</div>
td .icons{
width:20px;
text-align:center;
}
Here is the end result that I want (in a perfect world this would be done using CSS and the same HTML DOM I provided)
I was unable to do it without adding another pull-right container, I fear that doing it with only CSS would end up being an odd hack
Fixed here : http://jsfiddle.net/QTXxp/2/
What was lacking when I asked this question was the clear:right; and the use of <div> (or display: block;)
Here is the CSS (if you're too lazy to open the JSFiddle) with the addition of the boostrap class pull-right on the div.icons
textarea.hover-edit {
width: 90% !important;
}
div.icons {
width: 10% !important;
}
div.icons > div > i.fa {
margin-top: 4px;
margin-right: 4px;
}
div.icons > div.action-icon-right {
float:right;
clear:right;
}

How can I get these two widgets to align horizontally using CSS selectors?

I created an area in my WordPress theme where I can include a widget. Well, I included a social follow widget and I also included a Facebook Follow/Subscribe widget.
The problem is that the Facebook widget appears below the social widget -- and I'd like the social widget to be flush left, and the facebook widget to flush right.
Here is what it looks like on the website:
And here is the "general" Firebug of it:
I have tried to learn CSS, but I still get confused with selectors and the differences between text-align:left or float:left, etc. ... Here is what it looks like when you open up those "asides" in firebug:
I must have tried 30 different types of CSS rules and I cannot get that Facebook Follow widget to show up on the same line as the social widget, flushed right.
I can say that the one thing that I've tried that has worked for me has been this:
#social_sprites_widget-6 .ss {
text-align: left;
}
#social_sprites_widget-6 .widgettitle {
color: white!important;
text-align: left;
}
Lastly, here is what happens when I highlight the two "asides" and right click/copy html (not "inner html", which is similar):
<aside class="widget php-text catalyst-widget-area catalyst_hook_after_header" id="php-
text-13"><div class="widget-wrap"><div class="php-textwidget"><div data-show-faces="false"
data-colorscheme="dark" data-width="200" data-href="https://www.facebook.com/occupyhln.org"
class="fb-follow fb_iframe_widget" fb-xfbml-state="rendered"><span style="vertical-align:
bottom; width: 225px; height: 24px;"><iframe width="200px" scrolling="no" height="1000px"
frameborder="0" name="f28a55d5f531d8" allowtransparency="true" title="fb:follow Facebook Social
Plugin" style="border: medium none; visibility: visible; width: 225px; height: 24px;"
src="http://www.facebook.com/plugins/follow.php?href=https%3A%2F
%2Fwww.facebook.com%2Foccupyhln.org&show_faces=false&width=200&color_scheme=dark&
amp;app_id=499338670149736&locale=en_US&sdk=joey&channel=http%3A%2
%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D26%23cb%3Df2e90aca0c1a8de%26origin%3Dhttp%253A%252F%252Fwww.occupyhln.org%252Ff3e71b0d8eec812%26domain%3Dwww.occupyhln.org%26relation%3Dparent.parent" class=""></iframe></span></div></div></div></aside>
That has gotten the social sprites and title to flush left. But I cannot do anything with the Facebook follow widget. Any help in eliminating this headache ... it's at http://www.occupyhln.org .. would be greatly appreciated!
You have 2 options to accomplish this:
Option 1:
CSS:
#wrap .Social.Sprites{ width:auto; }
#wrap .php-text.catalyst-widget-area{ float:right;width:auto; }
both will be in the same line but you will lose the black background (since the background is part of the social icons widget), you will need to wrap both widgets on a div like this:
<div class="mySocialMediaWidgetArea">
/* social icons widget here*/
/* follow us widget here */
</div>
and add to the CSS .mySocialMediaWidgetArea{background:#000;}
Option 2:
CSS
#wrap .php-text.catalyst-widget-area{
float: right;
width: auto;
margin: -80px 0 0 0;}
the key here its width:auto, you weren't able to use float or text-align to put them in the same line because both widgets have width:100%, i am using classnames instead of ID's since if you delete and create a new widget the ID will change and you will have to update the CSS in that case.

How to get rid of this sliver of white between DIVs?

I am currently having trouble getting rid of a sliver of white...
Here is an example page: http://m.stackoverflow.quickmediasolutions.com/view_question.php?id=97969&site=serverfault
As you can see, the answers have a sliver of white stuffed between the top of the 'button' and the content.
Here is some relevant code:
<!-- this is the top of the 'button' -->
<div class='top'></div>
<!-- right here is where the space is -->
<div class='content'></div>
.top {
height: 5px;
}
.content {
display: block;
padding-left: 10px;
}
Edit: this problem is fixed now and I will accept the answer below shortly.
This looks like native margin the <p> element has:
.question p { margin: 0 }
A relevant tip here it to use a CSS-Reset, it eliminates most of these oddities and cross-browser compatibility issues.
you know, you'd be surprised how often whitespace breaks layout. I found out the hard way.
Just for $hits and giggles write it out together and see what happens:
<div class='top'></div><div class='content'></div>
and of course I would make sure that in your css you define margin:0px; for both divs

Resources