Bài đăng

Reating Intrinsic Ratios for Video theo http://alistapart.com/article/creating-intrinsic-ratios-for-video

Hình ảnh
Did you ever want to resize a video  on the fly , scaling it as you would an image? Using intrinsic ratios for video, you can. This technique allows browsers to determine video dimensions based on the width of their containing block. 24 comments Share this on Get a great domain name for your great idea at  Hover.com Ad via The Deck JOB BOARD Spiffy is looking for a Go Developer. Job listings via  We Work Remotely With intrinsic dimensions, a new width triggers a new height calculation, allowing videos to resize and giving them the ability to scale the same way images do. See example one . The concept The idea is to create a box with the proper ratio (4:3, 16:9, etc.), then make the video inside that box stretch to fit the dimensions of the box. It’s that simple. The trick The  padding  property is the magic that styles a box with an  intrinsic ratio . This is because we’ll set padding in a  percentage , based on the  width  of the containing block. T

Responsive cho Video

To scale a YouTube video to fit any browser or tablet/mobile device for responsive design you can use either a CSS or Javascript solution to accomplish the goal. This example uses a CSS solution, you need to add a couple of CSS styles in your main CSS file. The Process The first thing that you need is the YouTube iframe embed code, grab that in your video share options from the YouTube site. Place the iframe code on your page, in this example above the iframe's container div (div.youtubevideowrap)  has 2 CSS declarations for width, it has a  width:80%  and a  max-width:640px . This makes the content fluid as a percentage unit is used, it also has a max-width set as I don't want the video displaying wider than 640px From here we need to add in a HTML container around the video and declare the CSS. Setting Up the HTML and CSS Styles Create a container div around the iframe code and give it a class eg: <div class="video-container"><iframe......

Tổng quan kiến trúc của Entity Framework

Hình ảnh
ADO.NET Entity Framework là một nền tảng được sử dụng để làm việc với database thông qua cơ chế ánh xạ Object/Relational Mapping (ORM). Nhờ đó, bạn có thể truy vấn, thao tác với database gián tiếp thông qua các đối tượng lập trình. Kiến trúc của Entity Framework được minh họa như sau: Các nội dung dưới đây sẽ đi vào giải thích từng phần trong sơ đồ trên. Trong giới hạn của bài viết, tôi chỉ đi khái quát để bạn nắm được nội dung chính. Trong thực tế, bạn cũng không cần biết sâu hơn về kiến trúc bên dưới trừ những mục đích đặc biệt. Object Services Đây là các class tự động sinh ra tương ứng với mô hình dữ liệu. Các class này bao gồm: –       ObjectContext  đại diện cho một database. ObjectContext có chức năng quản lý các kết nối, định nghĩa mô hình dữ liệu với metadata và thao tác với database. Lớp này cũng có thể thêm vào các phương thức đại diện cho các stored procedure trong database. –       ObjectSet<TEntity>  là một  một tập hợp các entity. Mỗi đối tượng này