How to Change the CSS Style, Font, Spacing, Alignment and Color of WordPress Image Captions Làm thế nào để thay đổi các kiểu CSS, Font, Spacing, sắp và màu của Captions Hình WordPress
Since WordPress Kể từ WordPress version 2.6 phiên bản 2,6 , WordPress has added a built-in shortcode, “Caption”, which will be automatically rendered and translated into standard HTML CSS code to display the caption for the photo or image, which saved via media uploader, beneath it. , WordPress đã được tích hợp sẵn trong shortcode, "Chú thích", mà sẽ được tự động kết xuất và dịch sang mã chuẩn CSS HTML để hiển thị các chú thích cho hình ảnh hoặc hình ảnh, mà được lưu thông qua phương tiện truyền tải lên, bên dưới nó.
However, when WordPress appends the DIV styles to print the caption title under the picture or image, WordPress makes use of default alignment, color, font, spacing, and other styling attributes to display the image captions. Tuy nhiên, khi WordPress gắn thêm các phong cách DIV để in tiêu đề chú thích dưới hình ảnh hoặc hình ảnh, WordPress làm cho việc sử dụng sắp xếp mặc định, màu sắc, font chữ, khoảng cách, và phong cách khác thuộc tính để hiển thị các chú thích ảnh.
The default CSS styles for image with the caption may potentially breaks the blog or web page layout, does not validate against W3C xHTML standard, appears too closely with the text with no spacing in the post or page, or does not align as author's wish. CSS mặc định cho hình ảnh với các chú thích có thể có khả năng phá vỡ các blog hoặc bố trí trang web, không xác nhận đối với chuẩn XHTML của W3C, xuất hiện quá chặt chẽ với các văn bản không có khoảng cách trong bài viết hay trang, hoặc không align như mong muốn của tác giả.
For blogger who wants to modify the CSS styles of the caption that shows the image captions on screen after parsing the shortcode, add the following CSS code into the active theme's style.css file: Cho các blogger những ai muốn thay đổi phong cách CSS của chú thích rằng sẽ đưa ra các chú thích hình ảnh trên màn hình sau khi phân tích shortcode, thêm đoạn code CSS sau đây vào tập tin style.css chủ đề đang hoạt động của:
/* Captions */
.aligncenter,
div.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
.wp-caption {
border: 1px solid #ddd;
text-align: center;
background-color: #f3f3f3;
padding-top: 4px;
margin: 10px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.wp-caption img {
margin: 0;
padding: 0;
border: 0 none;
}
.wp-caption p.wp-caption-text {
font-size: 11px;
line-height: 17px;
padding: 0 4px 5px;
margin: 0;
}
/* End captions */
Above HTML CSS declaration is taken from WordPress 2.6 default theme. CSS HTML trên tờ khai được lấy từ 2,6 WordPress theme mặc định. These newly added CSS styles are used to control and assign the appearance of the caption for the image posted on blog. Những phong cách vừa được thêm vào CSS được sử dụng để kiểm soát và ấn định sự xuất hiện của các chú thích cho hình ảnh được đăng trên blog. Modify the code above in “style.css” file according to your own preference to have your own design and look. Thay đổi mã ở trên trong "style.css" file tùy theo sở thích riêng của bạn để có thiết kế riêng của bạn và xem xét.
IMPORTANT : The page is machine translated and provided "as is" without warranty. Quan trọng: Sửa là máy dịch và cung cấp "như là" không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể khó hiểu. Please refer to Vui lòng tham khảo original English article bản gốc tiếng Anh bài viết whenever possible. bất cứ khi nào có thể.
Related Articles Bài viết liên quan
- How to Disable Image and Video Captions Feature and Auto Adding of Shortcode in WordPress 2.6 Làm thế nào để hình ảnh và video Captions Vô hiệu hoá tính năng và Auto Thêm của Shortcode trong WordPress 2,6
- Caption Disabler WordPress Plugin to Disable and Remove Captions Functionality Caption Disabler WordPress Plugin để Vô hiệu hoá và Hủy bỏ Captions Chức năng
- Switch and Change Back to Office 2003 Default Font and Style Set in Office Word 2007 Chuyển đổi và thay đổi Quay lại Office 2003 và Set Default Font Style trong Office Word 2007
- Download ING Change Font to Personalize your Windows Mobile Device Tải ING Thay đổi chữ để Windows Cá nhân hoá thiết bị di động của bạn
- How to Change the Frequency or Interval WordPress Auto Saves An Editing Post or Page Làm thế nào để thay đổi các tần số hoặc Interval WordPress Auto Tiết kiệm An Post Chỉnh sửa hoặc Trang
- How to Customize, Modify or Change WordPress Database Connection Error Page Làm thế nào để Customize, Chỉnh sửa hoặc thay đổi kết nối WordPress Cơ sở dữ liệu Lỗi Trang
- WordPress 2.6 with Change Revision Tracking Feature Available for Free Download WordPress 2.6 với Change Revision Theo dõi năng có sẵn cho Miễn phí Tải
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working Paginating hoặc Split WordPress Đăng hoặc Trang với NextPage trong WordPress Không phải làm việc
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3 Cột Relaxation WordPress Chủ đề ý kiến-paged.php cho paged-Bình luận WordPress Plugin
- AdSense New Ads Style with Horizontal Image and Ad Links AdSense mới Quảng cáo kiểu với hình ngang và Liên Kết Quảng Cáo










































October 27th, 2008 18:05 Ngày 27 tháng 10 năm 2008 18:05
Wow, klasse für den CSS-Tipp. Wow, Klasse für den CSS-Tipp. Habe den gleiche mal eingebaut und finde die Formatierung einfach klasse. Habe den finde gleiche mal eingebaut und die Formatierung Klasse einfach. Sieht optisch sehr ansprechend aus. Sieht optisch sehr ansprechend aus.
Danke und gruss Danke und gruss
September 16th, 2008 01:05 Ngày 16 tháng 9 2008 01:05
Thank you so much for sharing this code! Cảm ơn bạn rất nhiều cho việc chia sẻ mã này! I was going nuts trying to figure out how to fix my captions! Tôi đã đi hạt cố gắng tìm ra cách để sửa chú thích của tôi!
July 20th, 2008 10:05 20 tháng 7 năm 2008 10:05
For the life of me, I cannot get captions to work. Đối với cuộc sống của tôi, tôi không thể có được chú thích để làm việc. It looks great in preview, but live, all the code spills out around the photo and there's no caption at all. Nó sẽ rất tốt trong xem trước, nhưng sống, tất cả các mã đã tràn ra xung quanh hình ảnh này và không có chú thích ở tất cả. I added the caption code to my theme's style.css but there was no change. Tôi bổ sung mã chú thích cho style.css chủ đề của tôi nhưng không có thay đổi. Seems like I'm just one minor step away from making this work. Có vẻ như thế tôi chỉ là một trẻ vị thành niên bước ra khỏi làm cho công tác này. If anyone has any ideas, I'd love to hear them. Nếu ai có bất kỳ ý tưởng, tôi muốn nghe họ. I'll add a caption to my first post to demonstrate. Tôi sẽ thêm một chú thích để đăng bài đầu tiên của tôi để chứng minh.