As of right now, there is way too much space after the widget title, before the widget content. How do I adjust this to make it smaller?
adjust the margins or paddings in your style.css;
details, i.e. the css selectors, depend on the way you have registered the sidbars in functions.php;
http://codex.wordpress.org/Function_Reference/register_sidebar
try and use a tool such as Firebug http://getfirebug.com/ to get more insight into those selectors.
// Declare sidebar widget zone
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Sidebar Widgets',
'id' => 'sidebar-widgets',
'description' => 'These are widgets for the sidebar.',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h5>',
'after_title' => '</h5>'
));
}
that is my functions.php
i have tried these CSS codes with no success
#sidebar {
float:right;
width:300px;
margin: 0;
padding: 0;
}
#sidebar .widget-title {
padding:0;
}
.widget {padding: 0px;}
.widget-content {margin-top: 5px;}
you can view the site here
excuse the rest of the appearance, its a work in progress
there is no .widget-title class with your widget titles, they are simply h5 – as it is defined in here: 'before_title' => '<h5>',
for these fundamental formatting problems, try using browser tools such as Firebug http://getfirebug.com/, or whatever your browser offers as inspection tool, to identify what influences the formatting of the elements.
if you want to continue customizing WordPress themes or any web applications, you will need to get familiar with css – http://www.w3schools.com/css/
i’m familiar with the css, its the php that is throwing me. I understand the titles are styled with the h5, as it was originally an h2 from where I pulled the code, and I adjusted it, but even then, it was displaying a huge gap. I have also been using firebug, but it just shows a large space that seems to be connected with the h5, yet I can’t change it.
i fixed it with clear: both
browsers are applying default styles to the html tags, including the h5 tag, such as margins and padding, and font size, etc.
to reduce the gap, set the bottom margin of #sidebar h5 to something small.
this is one of the reasons that some themes are using a ‘reset’ style section, to set all those defaults to zero, and then are adding formatting to the relevant elements.
nothing to do with php, and not a WordPress problem.
I do have the reset codes at the opening of my stylesheet