简体   繁体   English

CSS blogspot背景定位帮助

[英]CSS blogspot background positioning help

i'm trying my hands on coding a skin for blogspot.com i basically got everything else done except for one issue which is a part of my design. 我正在尝试为Blogspot.com编码皮肤,除一个问题(这是我设计的一部分)外,我基本上完成了所有其他工作。

Beside the title of the blog, i've design it such that there will be an image floating right next to the title of the blog. 在博客标题旁边,我对其进行了设计,以便在博客标题旁边浮动一个图像。 That would be easy if i were to use add in a tag into the widget section, but if i were to share this among people (where they will also have different blog name which result in different length) so the image will move according to the title's length. 如果我要在小部件部分中使用添加标记,那将很容易,但是如果我要在人们之间共享此标记(他们还将拥有不同的博客名称,从而导致长度不同),因此图像将根据标题的长度。 I'm having problem with this. 我对此有疑问。

I've no idea how i should attempt on this as i can't use php on blogspot =/ 我不知道该如何尝试,因为我不能在blogspot上使用php = /

To better understand what i said, here's an example of what i meant http://i558.photobucket.com/albums/ss23/crayscrays/randomfonthelp.jpg 为了更好地理解我所说的内容,以下是我的意思的示例http://i558.photobucket.com/albums/ss23/crayscrays/randomfonthelp.jpg

Since it's applied as a background image, you can set the value as "right", to make it go to the right side of the element. 由于它是作为背景图像应用的,因此您可以将值设置为“ right”,以使其位于元素的右侧。

Say, for example, this is your markup: 举例来说,这是您的标记:

<h1>This is a blog post</h1>

Your CSS would look something like this: 您的CSS看起来像这样:

h1 { 
  background: transparent url(myimage.jpg) no-repeat right center; 
  padding-right: [widthOfImage]px;
}

That would align the image to the right side of the text. 这将使图像与文本的右侧对齐。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM