gwmbox
05-12-2015, 01:51 AM
Hi all
I know I can setup different media sizes for responsive view, but I am trying to work out how I can do this dynamically via responsive css (only).
What I have is a small logo image that could be used as a background or aa an image and then there is the site title that has space between for where the logo should appear. The title is a simple two word title which should make things easier. Both the site title words and the logo need to auto resize based on screen with.
So in essence I am wanting
header text word 1 - image - header text word 2
Some css I have been playing with but not able to get it to work is
#header {
max-width:100%;
border-bottom:0 none;
}
#header {
background-repeat:no-repeat;
background-size:contain;
background-position:center;
}
#header #site-title {
height:101px;
height:6.3125rem;
font-size:56px;
font-size:3.5rem;
line-height:99px;
line-height:6.1875rem;
word-spacing:104px;
word-spacing:6.5rem;
text-align:center;
text-transform:uppercase;
background: transparent url(images/logo.png) no-repeat 49% 0;
white-space: nowrap
}
The above tries to use the logo as a background, but if it would work better as a standard image I'd be happy (actually better for me) to change that
The html output I have tried several ways as shown here
<div id="header">
<h1 id="site-title"><a href="http://mysite.com/">Two Words</a></h1>
</div>
<div id="header">
<img src="http://mysite.com/logo.png" alt="Two Words"><h1 id="site-title"><a href="http://mysite/">Two Words</h1></a>
</div>
<div id="header">
<h1 id="site-title"><a href="http://mysite/"><img src="http://mysite.com/logo.png" alt="Two Words">Two Words</a></h1>
</div>
Thanks for your help
I know I can setup different media sizes for responsive view, but I am trying to work out how I can do this dynamically via responsive css (only).
What I have is a small logo image that could be used as a background or aa an image and then there is the site title that has space between for where the logo should appear. The title is a simple two word title which should make things easier. Both the site title words and the logo need to auto resize based on screen with.
So in essence I am wanting
header text word 1 - image - header text word 2
Some css I have been playing with but not able to get it to work is
#header {
max-width:100%;
border-bottom:0 none;
}
#header {
background-repeat:no-repeat;
background-size:contain;
background-position:center;
}
#header #site-title {
height:101px;
height:6.3125rem;
font-size:56px;
font-size:3.5rem;
line-height:99px;
line-height:6.1875rem;
word-spacing:104px;
word-spacing:6.5rem;
text-align:center;
text-transform:uppercase;
background: transparent url(images/logo.png) no-repeat 49% 0;
white-space: nowrap
}
The above tries to use the logo as a background, but if it would work better as a standard image I'd be happy (actually better for me) to change that
The html output I have tried several ways as shown here
<div id="header">
<h1 id="site-title"><a href="http://mysite.com/">Two Words</a></h1>
</div>
<div id="header">
<img src="http://mysite.com/logo.png" alt="Two Words"><h1 id="site-title"><a href="http://mysite/">Two Words</h1></a>
</div>
<div id="header">
<h1 id="site-title"><a href="http://mysite/"><img src="http://mysite.com/logo.png" alt="Two Words">Two Words</a></h1>
</div>
Thanks for your help