문제

I need to change the word "comment" to "Sign the Guestbook" on my Squarespace blog. The support team said I could do this through CSS but they couldn't offer any further help with this "advanced modification." All help is appreciated. Thanks a lot guys. -Dan

도움이 되었습니까?

해결책

There isn't really a nice way to do this with CSS, but it can be done.

Let's say you have the following markup:

<span>Comment</span>

Adding a psuedo-element with :after will produce something like "CommentSign the Guestbook":

span:after { content: "Sign the Guestbook"; }

Then you can hide the actual text and reposition the replacement text:

span {
  display:inline-block;
  text-indent:-9999px;
}
span:after {
  content: "Sign the Guestbook";
  margin-left:9999px;
}

It's not perfect, and it's better to just change the actual text. Replace span with the element that has the text, and reduce the margin-left by the amount you suspect the original text takes up. You could also use a background image with the desired text, but that's kind of a pain and harder to edit.

Demo: http://jsfiddle.net/zjrSj/1/

다른 팁

Open up your HTML/PHP file and change it to Sign the Guestbook. You can't do it in CSS unless you do some bizarre thing. If this doesn't help you, then please post your code so I can manually help you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top