Hallo zusammen,
ich bin ein absoluter CSS und HTML-Neuling. Ich heirate im Herbst und möchte eine Hochzeitshomepage einrichten.
Mit Wordpress funktioniert das auch überraschend gut und ich bin mit dem Ergebnis zufrieden, nur ich bekomme das Logo im Header nicht zentriert.
Das Stylesheet des Templates Tiny
Framework https://de.wordpress.org/themes/tiny-framework/ist für meine Begriffe so ausführlich, dass ich mit den üblichen Recherchen und Tipps einfach nicht weiterkomme. Ich hab schon alles Mögliche versucht, aber wenn man die Grundstruktur nicht versteht …
Ich hoffe sehr, dass es für einen für Euch simpel sein wird und sollte sich gleich jemand an den Kopf fassen, weil ich selbst nicht drauf gekommen bin, dann entschuldige ich mich gleich schon mal für das dicke Brett vor meinem Kopf.
Und ich hoffe, Euch die richtigen Teile aus dem CSS und HTML Code kopiert zu haben:
Herzlichen Dank,
Line
Hmtl:
<?php
/**
* The header for our theme.
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Tiny_Framework
* @since Tiny Framework 1.0
*/
?><!DOCTYPE html>
<?php tha_html_before(); // custom action hook ?>
<!--[if IE 8]>
<html class="ie ie8 no-js" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE ]><!-->
<html <?php language_attributes(); ?> class="no-js">
<!--<![endif]-->
<head>
<?php tha_head_top(); // custom action hook ?>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="profile" href="http://microformats.org/profile/specs" />
<link rel="profile" href="http://microformats.org/profile/hatom" />
<?php tha_head_bottom(); // custom action hook ?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?><?php tinyframework_semantics( 'body' ); // Function located in: inc/semantics.php ?>>
<?php tha_body_top(); // custom action hook ?>
<span class="skiplink"><a class="screen-reader-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'tiny-framework' ); ?>"><?php esc_html_e( 'Skip to content', 'tiny-framework' ); ?></a></span>
<?php // Tip04 - Reminder to turn ON JavaScript ?>
<noscript>
<div id="no-javascript">
<?php esc_html_e( 'Advanced features of this website require that you enable JavaScript in your browser. Thank you!', 'tiny-framework' ); ?>
</div>
</noscript>
<div id="page" class="site">
<?php tha_header_before(); // custom action hook ?>
<header id="masthead" class="site-header" role="banner" itemscope="itemscope" itemtype="https://schema.org/WPHeader">
<?php tha_header_top(); // custom action hook ?>
<div class="site-branding" itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<?php // Tip14 - custom logo feature support. Check: inc/template-tags.php for more details.
tinyframework_the_site_logo();
?>
<div id="site-title-wrapper">
<?php
if ( is_front_page() && is_home() ) : ?>
<h1 id="site-title"<?php tinyframework_semantics( 'site-title' ); // Function located in: inc/semantics.php ?>><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"<?php tinyframework_semantics( 'site-url' ); // Function located in: inc/semantics.php ?>><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<p id="site-title"<?php tinyframework_semantics( 'site-title' ); // Function located in: inc/semantics.php ?>><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"<?php tinyframework_semantics( 'site-url' ); // Function located in: inc/semantics.php ?>><?php bloginfo( 'name' ); ?></a></p>
<?php endif;
$description = get_bloginfo( 'description', 'display' );
if ( $description || is_customize_preview() ) :
?>
<p id="site-description"<?php tinyframework_semantics( 'site-description' ); // Function located in: inc/semantics.php ?>><?php echo $description; ?></p>
<?php endif;
?>
</div><!-- #site-title-wrapper -->
</div><!-- .site-branding -->
<?php
/* Accessibility. Aria Label: Provides a label to differentiate multiple navigation landmarks
* hidden heading: provides navigational structure to site for scanning with screen reader
*/
?>
<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'tiny-framework' ); ?>" itemscope="itemscope" itemtype="https://schema.org/SiteNavigationElement">
<h2 class="screen-reader-text"><?php esc_html_e( 'Primary Menu', 'tiny-framework' ); ?></h2>
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Menu', 'tiny-framework' ); ?></button>
<?php // Search form for mobile menu ?>
<div class="search-box-wrapper search-container-mobile">
<div class="search-box">
<?php get_search_form(); ?>
</div>
</div>
<!--<button class="go-to-top"><a href="#page"><span class="icon-webfont fa-chevron-circle-up" aria-hidden="true"></span></a></button>-->
<?php wp_nav_menu( array(
'theme_location' => 'primary',
'menu_id' => 'primary-menu',
'menu_class' => 'nav-menu',
'depth' => 4,
) );
?>
</nav><!-- #site-navigation -->
<!-- Custom Header - Start -->
<?php // Tip06 - Custom headers for posts and pages
$header_image = get_header_image();
if ( function_exists( 'get_custom_header' ) ) {
/* We need to figure out what the minimum width should be for our featured image
* This result would be the suggested width if the theme were to implement flexible widths
*/
$header_image_width = get_theme_support( 'custom-header', 'width' );
}
?>
<?php
/* The header image
*
* Check if this is a post or page, if it has a thumbnail, and if it's a big one
* You can also check if it's not password protected, just add this condition: && ! post_password_required()
*/
if ( is_singular() && has_post_thumbnail( $post->ID ) &&
( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
$image[1] >= $header_image_width ) :
// Houston, we have a new header image!
echo get_the_post_thumbnail( $post->ID, 'custom-header-image', array(
'class' => 'photo u-photo', // At this point using a work-around: https://core.trac.wordpress.org/ticket/36996#comment:3 that is added as 12.5 in functions.php
'id' => 'featured-image', // Experimental! This ID (should it be #post-thumbnail ?) could be used for the itemref in the article element (in inc/semantics.php) for the Google AMP Articles Rich Snippets "Article image" validation.
'itemprop' => 'image',
) );
else :
if ( function_exists( 'get_custom_header' ) ) {
$header_image_width = get_custom_header()->width;
$header_image_height = get_custom_header()->height;
}
?>
<?php
// Check to see if the header image has been removed.
if ( ! empty( $header_image ) ) : ?>
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
<?php endif; // end check for removed header image ?>
<?php endif; // end check for featured image or standard header ?>
<!-- Custom Header - End -->
<?php tha_header_bottom(); // custom action hook ?>
</header><!-- .site-header -->
<?php tha_header_after(); // custom action hook ?>
<div id="content" class="site-content">
<header id="startbildschirm">
<div id="logobox">
<img id="logo" src="bilder/logo.png" />
</div>
</header>
Alles anzeigen
Css:
/* 10.0 Header
-------------------------------------------------------------- */
/* Tip04 - Reminder to enable JavaScript */
#no-javascript {
background-color: #ed0000;
color: #fff;
font-weight: bold;
padding: 5px 0;
padding: 0.3125rem 0;
text-align: center;
}
/* 10.1 Site Header */
.site-header {
padding: 0;
/* overflow: hidden; */ /* In case custom logo is too wide - Had to disable it to make header shadows visible */
}
#site-title-wrapper {
float: none;
padding-top: 12px;
padding-top: 0.75rem;
}
.site-branding {
/* Avoid overflowing wide custom logo in small screens in Firefox and IEs */
max-width: 100%;
min-width: 0;
overflow: hidden;
}
.site-header .site-description,
.site-header .site-title {
text-align: center;
}
/* Tip88 - Customize color scheme: Site Title and Description - can also be changed via Admin > Appearance > Customizer */
.site-header .site-description a,
.site-header .site-title a {
color: #515151;
display: inline-block;
text-decoration: none;
}
.site-header .site-description a:focus,
.site-header .site-description a:hover,
.site-header .site-title a:focus,
.site-header .site-title a:hover {
color: #ff6111;
text-decoration: underline;
}
.site-header .site-description {
color: #757575;
font-size: 13px;
font-size: 0.8125rem;
font-weight: normal;
margin: 0;
}
.site-header .site-title {
color: #515151;
font-size: 24px;
font-size: 1.5rem;
font-weight: bold;
line-height: 1.285714286;
margin-bottom: 14px;
margin-bottom: 0.875rem;
margin-top: 0;
}
/* Tip14 - Custom logo feature support. Check: inc/template-tags.php for more details. */
.site-logo-link, /* deprecated */
.custom-logo-link {
display: none;
}
.custom-logo {
margin: 0 auto;
}
/* Enable custom logo in mobile view */
/*
.site-branding {
margin-top: 12px;
margin-top: 0.75rem;
}
.site-logo-link,
.custom-logo-link {
display: block;
float: left;
margin: 5px 24px 0 0;
margin: 0.3125rem 1.5rem 0 0;
}
#site-title-wrapper {
padding: 12px 0 12px 12px;
padding: 0.75rem 0 0.75rem 0.75rem;
}
.site-header .site-title,
.site-header .site-title a {
clear: none;
display: inline;
}
.site-header .site-description,
.site-header .site-title {
text-align: left;
}
*/
img.header-image,
.site-header img.wp-post-image {
margin-left: auto;
margin-right: auto
}
img {
display: inline-block;
vertical-align: middle;
max-width: 100%;
height: auto;
}
Alles anzeigen